When specifying on-demand or scheduled outputs, you can define SQL scripts to execute before data ingestion, after output publication, or both. These scripts can be executed through any database connection to which you have write access.


NOTE: This feature may need to be enabled by a workspace administrator. For more information, see Workspace Settings Page.


When specifying your output, you can choose to add SQL scripts. 

SQL Scripts panel

Columns:

Actions:

Add SQL Script Window

Enter your SQL statement in the window.

Add SQL Script window

Steps:

  1. Select the connection through which to apply the SQL statement. 
  2. Enter your SQL statements in the window:

    NOTE: Each line must end with a semi-colon (;). Validation fails if otherwise.

    1. You may enter multi-statement SQL scripts.

    2. SQL lines in an individual script are executed in the order listed in the script.

    3. Your SQL statements must comply with the expected syntax of the target system. For more information, see Supported SQL Syntax.

  3. Choose when to run the SQL script:

    1. Run before data ingest: SQL script is executed before the data is ingested for a job run.

    2. Run after data publish: SQL script is executed after that data has been published from a job run.

  4. To validate your SQL, click Validate SQL

  5. To add the SQL script, click Add

If you have defined multiple scripts of the same type (before data ingest, for example), those scripts may be executed in parallel. 

NOTE: The order of listing of scripts in the does not affect the order of execution of those scripts.

For more information on managing SQL scripts, see Create Output SQL Scripts.