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 STATEMENTcommand (see EXECUTE STATEMENT.) A statement that produces a result set (e.g.
SELECT), needs a cursor to read it.
You can use the
SCROLLoption to specify that the result set should be read by a scrollable cursor.
If you use the
NO SCROLLoption, 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.
call-statement, see CALL.
delete-statement, see DELETE.
insert-statement, see INSERT.
select-statement, see SELECT.
set-statement, see SET.
update-statement, see UPDATE.
The ident executing the
CREATE STATEMENTcommand must have adequate access rights to perform the stored command.
statement-namemust 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 form
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
Phone: +46 18 780 92 00