Syntax
DETERMINE ACTUAL <variant> [ GS status ] <logic_block> END | ENDEXIT | ENDNOPRINT <variant> := <databaseVariant> | <extractFileVariant> | <sqlVariant> <sqlVariant> := sql_script
Parameters
sql_script
The SQL script to run.
Description
The SQL script variant of the Determine Actual logic command runs embedded SQL statements in an SQL script. This command is variant is not applicable to systems based on the MCP platform.
SQL script variants of the Determine Actual logic command that specify the same SQL script should not be nested, as inconsistent behavior can result due to likely conflicts in cursor and instance variable naming. However, it would be possible to create a duplicate SQL script which has different cursor and instance variable names which could then be nested into the original Determine Actual logic command loop.
Refer to SQL scripts and SQL script processing for more information on the usage and semantics of SQL scripts.
Break
Use of the SQL script variant of the Determine Actual logic command must be immediately followed by a conditional Break logic command, so as to prevent looping past the end of the selected data, which could cause an SQL error. Refer to Example 1 below.
For instances where SQL statements are to be executed once only, rather than within a loop, an unconditional Break logic command should be included with the Determine Actual logic command loop, in order to exit the loop following its first iteration. In these instances, the executed SQL statements are restricted to those within the SQL script's Construct method. Refer to Example 3 below.
Restrictions
The following restriction apples to the SQL script variant of the Determine Actual logic command: It is ignored by Debugger. Debugger disregards any SQL script variants of the Determine Actual logic command it encounters, and continues execution at the logic statement following the End or EndExit logic statement terminating the Determine Actual loop.
Examples
Example 1
This example uses a conditional Break logic command to prevent looping past the end of the selected data.
Determine Actual MySqlScript If Glb.MainSQLCode = 100 : 100 signals the end of the results set. Break End : Logic End
Example 2
This example also exits the loop at the end of the selected data:
Determine Actual MySqlScript If Glb.Status = "*****" Break End : Logic End
Example 3
This example executes the SQL statements (within the Construct method) of the MySqlScript SQL script just once.
Determine Actual MySqlScript : Logic Break : Unconditional exit End