Add Connection Scripts to a Connection Pool

You can add one or more connection scripts and set them to run before the connection is established, before a query is run, after a query is run, or after the connection is disconnected.

For example, you can create a connection script that on connect inserts the name of the user and the connection time into a table.

Connection scripts can contain any commands accepted by the database, such as a command to turn on quoted identifiers. This enables mainframe environments to maintain security in one central location.

Because the connection script is sent directly to the data source, you must write the script in native SQL. Don't write the script in Oracle Analytics Logical SQL because the data source won't understand it.

  1. On your home page, click Navigator Navigator icon and then click Semantic Models.
  2. In the Semantic Models page, click a semantic model to open it.
  3. Click Physical Layer Physical layer icon and locate and double-click a database.
  4. In the database's tab, click Connection Pools.
  5. In the connection pools list table, click a connection pool to select it and then click Detail view to open the properties pane.
  6. Scroll to Connection Scripts, click Add Script, and select when to run the script.
    A subsection is added for the selected connection script type.
  7. Write the script using native SQL or a language that the data source understands.
  8. Optional: Click Enable so that the script runs before the connection is established.
  9. Click Save.