RunSQL macro

The RunSQL macro is used to run the specified SQL Command on a specified data source. This macro command is executed at system level.

For executing the macro, the value in the Command field must be specified in this format:

RunSQL(Data Source, SQL Command, [Timeout])

The optional parameters are specified in [ ].

This table lists the parameters that are used to define the SQL command to be executed for the specified data source:

Parameter Name Description
Data Source The name of the data source for which the command is executed.
SQL Command The SQL command to run.
Time out The time, in seconds, to wait for blocking processes to complete (if processing currently).
Note: If this value is not specified, the waiting period is indefinite.

This table lists the examples of the RunSQL macro:

Requirement Syntax
Run the database stored procedure mlcs_rp.batchcalcsched with the specified parameters against the DPOracleDB data source. RunSQL("DPOracleDB","begin mlcs_rp.batchcalcsched(null, 'chan_prods.cp_ref = chan_prods.cp_ref', null, null, null, null, 1, null, null, false); end;","")
Run the database stored procedure mlcs_rp.batchcalcsched with the specified parameters against the DPOracleDB data source, with a time out of 600 seconds, if the process is unavailable at the time of execution. RunSQL("DPOracleDB","begin mlcs_rp.batchcalcsched(null, 'chan_prods.cp_ref = chan_prods.cp_ref', null, null, null, null, 1, null, null, false); end;","600")