Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SPL Statements > IF >

SQL Statements Not Valid in an IF Statement

The "Subset of SQL Statements" element in the syntax diagram for the IF Statement List refers to all SQL statements, except for the following SQL statements, which are not valid in the IF statement list.

ALLOCATE DESCRIPTOR
CLOSE DATABASE
CONNECT
CREATE DATABASE
CREATE PROCEDURE
DATABASE
DEALLOCATE DESCRIPTOR
DECLARE
DESCRIBE
DISCONNECT
EXECUTE
EXECUTE IMMEDIATE
FETCH
FLUSH

LOAD
OPEN
OUTPUT
PREPARE
PUT
SET CONNECTION
SET DESCRIPTOR
UNLOAD
WHENEVER
FREE
GET DESCRIPTOR
GET DIAGNOSTICS
INFO

Many of these statements are prohibited by the more general rule that the dynamic management statements of SQL are not valid within an SPL routine.

You can use a SELECT statement only if you use the INTO TEMP clause to store the result set of the SELECT statement in a temporary table.

Related Statements

CASE, WHILE

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