Scripts

Top  Previous  Next

You can run one or more scripts in your project, simply by adding your existing script files to the project.

 

scripts_01

 

A script can contain a single batch:

 

scripts_02

 

or multiple batches.  To run multiple batches in a script, the first line of the script must start with a comment symbol, followed by the text MULTISQL.  E.g. in PostgreSQL, you would do this:

 

scripts_03

 

and in MySQL, you would do this:

 

scripts_04

 

When running a multi batch script, SQL Multi Select will label each batch as batch 1, batch 2, etc. e.g.

 

scripts_05

 

 

You can change this label to a more meaningful value by adding a comment before each batch.  E.g. by adding comments like this:

 

scripts_06

 

SQL Multi Select will use the comments to label the batches.

 

scripts_07

 

You can also specify script execution timeouts, so that SQL Multi Select will terminate the script execution after the specified interval.  To provide the timeout value, start a new line in the script with a comment symbol, followed by the text TIMEOUT=x, where x is the timeout value in seconds.  For e.g. if in a PostgreSQL project you run the following script:

 

timeout_01

 

The first 2 scripts will run with an execution timeout value of 10 seconds:

 

timeout_02

 

The last script will run with an execution timeout value of 30 seconds.

 

timeout_03