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
- DESCRIBE
- DISCONNECT
- DROP DATABASE
- EXECUTE
- FLUSH
- GET DESCRIPTOR
- GET DIAGNOSTICS
- INFO
- LOAD
- OUTPUT
- PUT
- RENAME DATABASE
- SET AUTOFREE
- SET CONNECTION
- SET DESCRIPTOR
- UNLOAD
- WHENEVER
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.