Stores a precompiled statement in the data dictionary for execution later.
The statement specified, stored with the name statement-name, is compiled and optimized and thereafter stored in its compiled form in the data dictionary.
The statement can then be executed through the EXECUTE STATEMENT command.
You can use the SCROLL option to specify that the result-set should be read by a scrollable cursor.
If you use the NO SCROLL option, the result-set will only be accessible for no-scroll cursors.
If you do not specify an option, the result-set can be used by both scroll and no-scroll cursors.
Once the precompiled statement has been created, only cursors with the correct scroll mode can be used to read the result-set.
select-statement, see SELECT.
call-statement, see CALL.
Data manipulation statements, e.g. UPDATE, INSERT or DELETE.
The ident executing the CREATE STATEMENT command must have adequate access rights to perform the stored command.
The statement-name must not be the same as any other statement name in the schema.
Parameter marker references may be used in the statement to denote values that are supplied when the statement is executed. Parameter markers can either be a ? or on the from :variable.
ExamplesCREATE SCROLL STATEMENT seltaba SELECT col1, col2 FROM taba WHERE col3 < 10 CREATE STATEMENT updtaba UPDATE taba SET col2 = :inpvar WHERE col3 < :col3var CREATE STATEMENT callme CALL proc1('ABC', ?)
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40