All statements submitted to dynamic SQL programs must be prepared. The simplest form of the operation uses a
PREPAREstatement, see the Mimer SQL Reference Manual, PREPARE, for the syntax description. The operation may also be combined with
EXECUTEas a simple statement in the shorthand form
The source form of the statement must be contained in a host variable, containing the statement string. (The statement string itself is not preceded by
EXEC SQLnor terminated by the language-specific embedded delimiter.)
The prepared form of the statement is named by an SQL-identifier or a host variable, for extended statements, see Extended Dynamic Cursors.
In the following example the source form of the statement is given as a string constant for illustrative purposes, however, the statement would usually be read from some input source, e.g. the terminal, at run-time:... EXEC SQL BEGIN DECLARE SECTION; string SQL_TXT(255); ... EXEC SQL END DECLARE SECTION; ... SQL_TXT := "CREATE INDEX pdt_product_search ON products(product_search)"; EXEC SQL PREPARE OBJECT FROM :SQL_TXT; ...
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40