(Contents)(Previous)(Next)

Overview of the Sequences of SQL Statements

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 [<variable>]];

The specification 'using descriptor' is optional. Default for <variable> is sqlda.

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>;


(Contents)(Previous)(Next)