Running an initialization script after connecting to the database
07 Feb 2017
KeepTool 12.1.3 introduced the ability to designate an initialization script to run immediately after logging on to Hora. For each database connection, an initialization script can be set in the expanded section of the Connect dialog window:
Although you may already have some ideas in mind for using this feature, we’d like to mention two situations in which it might be useful:
- When connecting using Oracle*Net, national language support variables are set automatically according to Windows environment variables and registry settings of your local machine. When using a direct TCP/IP connection, it’s up to you to initialize variables such as NLS_LANGUAGE or NLS_TERRITORY.
For your convenience, this can now be automated by placing the initialization in a script.
- PL/SQL coded business logic or fine grained access rules (virtual private database) may require some initialization that would normally be done by the (web) application after login. To allow testing from within Hora, you need a similar initialization that can be done now by the initialization script.
The following sample script performs an initialization of some NLS session variables. After that, a PL/SQL block is used to query the logged-in OS user name and pass it to your business logic:
After login, Hora shows a tooltip notification when running the login script:
Back to the overview