


General:
EXEC SQL PREPARE <STATEMENT NAME> ...;
EXEC SQL DESCRIBE <STATEMENT NAME>;
providing the SQLDA with information about the program variables;
EXEC SQL EXECUTE <STATEMENT NAME> [USING DESCRIPTOR];
The USING DESCRIPTOR specification is optional.
SQLDA is assumed as default.
When processing the result table by means of a cursor, the following sequence of SQL statements is valid,
for SELECT with parameters:
EXEC SQL PREPARE <SELECT NAME> ...;
EXEC SQL DECLARE <CURSOR NAME> CURSOR FOR <SELECT NAME>;
EXEC SQL DESCRIBE <SELECT NAME>;
providing the SQLDA with information about the program variables;
EXEC SQL OPEN <CURSOR NAME> USING DESCRIPTOR;
...
EXEC SQL PREPARE <FETCH NAME> ...;
EXEC SQL DESCRIBE <FETCH NAME>;
providing the SQLDA with information about the program variables;
EXEC SQL EXECUTE <FETCH NAME>;
...
EXEC SQL CLOSE <CURSOR NAME>;
for SELECT without parameters:
EXEC SQL PREPARE <SELECT NAME> ...;
EXEC SQL DECLARE <CURSOR NAME> CURSOR FOR <SELECT NAME>;
EXEC SQL OPEN <CURSOR NAME>;
...
EXEC SQL PREPARE <FETCH NAME> ...;
EXEC SQL DESCRIBE <FETCH NAME>;
providing the SQLDA with information about the program variables;
EXEC SQL EXECUTE <FETCH NAME>;
...
EXEC SQL CLOSE <CURSOR NAME>;
without cursor:
a select statement;
EXEC SQL PREPARE <FETCH_NAME> ....;
EXEC SQL DESCRIBE <FETCH_NAME>;
providing the SQLDA with information about the program variables;
EXEC SQL EXECUTE <FETCH_NAME>;


