SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
Embedded SQL Statements
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
2-15
CONTROL, Flow Control Scope, and Dynamic SQL
programs
The preceding static CONTROL QUERY statement does not apply to this dynamic 
statement when the user enters this dynamic SQL statement, and the default 
TABLELOCK strategy (SYSTEM) is used.
The second time through the loop, the user enters:
CONTROL QUERY DEFAULT TABLELOCK 'ON';
When the user enters this dynamic CONTROL statement, it is executed dynamically. 
As discussed previously, all subsequent SQL statements are affected by this 
CONTROL statement.
The third and final time through the loop, the user enters:
UPDATE sales SET SALARY = SALARY * 0.05;
In this dynamic SQL statement, the preceding CONTROL QUERY statement affects 
the TABLELOCK strategy. This example demonstrates the behavior of flow control 
scope. 










