Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Other Syntax Segments > Statement Block >

SQL Statements Not Valid in an SPL Statement Block

The diagram for the Statement Block refers to this section. The following SQL statements are not valid in an SPL statement block:

ALLOCATE COLLECTION
ALLOCATE DESCRIPTOR
ALLOCATE ROW
CLOSE
CLOSE DATABASE
CONNECT
CREATE DATABASE
CREATE FUNCTION
CREATE FUNCTION FROM
CREATE PROCEDURE
CREATE PROCEDURE FROM
CREATE ROUTINE FROM
DATABASE
DEALLOCATE COLLECTION
DEALLOCATE DESCRIPTOR
DEALLOCATE ROW
DECLARE
DESCRIBE

DISCONNECT
DROP DATABASE
EXECUTE
EXECUTE IMMEDIATE
FETCH
FLUSH
FREE
GET DESCRIPTOR
INFO
LOAD
OPEN
OUTPUT
PREPARE
PUT
RENAME DATABASE
SET CONNECTION
SET DESCRIPTOR
UNLOAD
UPDATE STATISTICS
WHENEVER

For example, you cannot close the current database or select a new database within an SPL routine. Likewise you cannot drop the current SPL routine within the same routine. You can, however, drop another SPL routine.

You can use a SELECT statement in only two cases:

If an SPL routine is later to be called as part of a data-manipulation language (DML) statement, additional restrictions exist. For more information, see Restrictions on SPL Routines in Data-Manipulation Statements.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]