8. OpenSQL Statements : OPEN : Syntax
 
Share this page                  
Syntax
The OPEN statement has the following format:
Non-dynamic version:
EXEC SQL OPEN cursor_name [FOR READONLY];
Dynamic version:
EXEC SQL OPEN cursor_name [FOR READONLY]
              [USING variable {, variable} |
              USING DESCRIPTOR descriptor_name];
FOR READONLY
Opens the cursor for reading only, even though the cursor may have been declared for update. This clause improves the performance of data retrieval, and can be used whenever appropriate.
USING variable {,variable} | USING DESCRIPTOR descriptor_name
Provides values for the constants that are in the prepared SELECT statement.