All statements submitted to dynamic SQL programs must be prepared. The simplest form of the operation uses a PREPARE statement, see the Mimer SQL Reference Manual, PREPARE, for the syntax description. The operation may also be combined with EXECUTE as a simple statement in the shorthand form EXECUTE IMMEDIATE.
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 SQL nor 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