Mimer SQL Programmer's Manual TOC PREV NEXT INDEX

Mimer Developer Site

www.mimer.com/developer


Preparing Statements


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 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;
 SQL_TXT  CHARACTER(255);
 ...
 exec sql END DECLARE SECTION;
 ...
 SQL_TXT := "CREATE INDEX ROOMHOT ON ROOMS(HOTELCODE)";
 exec sql PREPARE OBJECT FROM :SQL_TXT;
 ...


Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
dbtechnology@upright.se
Mimer SQL Programmer's Manual TOC PREV NEXT INDEX