Running a SQL Script Each Time a Connection is Established

Each time a connection is established, you may wish to run a SQL script (login SQL script). This could be used to alter session settings to modify NLS parameters or anything else. A login SQL script may be used for all connections, and it can be overridden on a per connection basis.

  • To set a login SQL script for all connections, go to the Extension Settings for Oracle Developer Tools for VS Code and set the Connection Configuration: Login Script value to the location of a sql script. For example, /myscripts/login.sql. Leave this setting blank if you only wish a log script to run for certain connections.

  • To set a login SQL script for a particular connection in Oracle Explorer, open the connection dialog. For example, select the connection and choose the Update menu item. In the connection dialog, check the Show more options checkbox and then populate the Login Script field. This script will override any login script set in the extension settings.

  • To view any output of the login SQL script, view the Results tab.