The following table indicates whether or not an SQL statement (specified in the first column) is allowed to execute in a function or procedure with the specified SQL data access indication. If an executable SQL statement is encountered in a function or procedure defined with NO SQL, SQLSTATE 38001 is returned. For other executions contexts, SQL statements that are not supported in any context return SQLSTATE 38003. For other SQL statements not allowed in a CONTAINS SQL context, SQLSTATE 38004 is returned and in a READS SQL DATA context, SQLSTATE 38002 is returned. During creation of an SQL function or SQL procedure, a statement that does not match the SQL data access indication will cause SQLSTATE 42895 to be returned.
SQL Statement | NO SQL | CONTAINS SQL | READS SQL DATA | MODIFIES SQL DATA |
---|---|---|---|---|
ALLOCATE DESCRIPTOR | Y | Y | ||
ALTER ... | Y | |||
BEGIN DECLARE SECTION | Y1 | Y | Y | Y |
CALL | Y | Y | Y | |
CLOSE | Y | Y | ||
COMMENT | Y | |||
COMMIT3 | Y | Y | Y | |
CONNECT (Type 1 and Type 2)3 | ||||
CREATE ... | Y | |||
DEALLOCATE DESCRIPTOR | Y | Y | ||
DECLARE CURSOR | Y1 | Y | Y | Y |
DECLARE GLOBAL TEMPORARY TABLE | Y | |||
DECLARE PROCEDURE | Y1 | Y | Y | Y |
DECLARE STATEMENT | Y1 | Y | Y | Y |
DECLARE VARIABLE | Y1 | Y | Y | Y |
DELETE | Y | |||
DESCRIBE | Y | Y | ||
DESCRIBE INPUT | Y | Y | ||
DESCRIBE TABLE | Y | Y | ||
DISCONNECT3 | ||||
DROP ... | Y | |||
END DECLARE SECTION | Y1 | Y | Y | Y |
EXECUTE | Y2 | Y2 | Y | |
EXECUTE IMMEDIATE | Y2 | Y2 | Y | |
FETCH | Y | Y | ||
FREE LOCATOR | Y | Y | Y | |
GET DESCRIPTOR | Y | Y | ||
GET DIAGNOSTICS | Y | Y | Y | |
GRANT ... | Y | |||
HOLD LOCATOR | Y | Y | Y | |
INCLUDE | Y1 | Y | Y | Y |
INSERT | Y | |||
LABEL | Y | |||
LOCK TABLE | Y | Y | Y | |
OPEN | Y | Y | ||
PREPARE | Y | Y | Y | |
REFRESH TABLE | Y | |||
RELEASE CONNECTION3 | ||||
RELEASE SAVEPOINT | Y | |||
RENAME | Y | |||
REVOKE ... | Y | |||
ROLLBACK3 | Y | Y | Y | |
ROLLBACK TO SAVEPOINT | Y | |||
SAVEPOINT | Y | |||
SELECT INTO | Y | Y | ||
SET CONNECTION3 | ||||
SET SESSION AUTHORIZATION | Y | Y | ||
SET CURRENT DEBUG MODE | Y | Y | ||
SET CURRENT DEGREE | Y | Y | ||
SET DESCRIPTOR | Y | Y | ||
SET ENCRYPTION PASSWORD | Y | Y | Y | |
SET OPTION | Y1 | Y | Y | Y |
SET PATH | Y | Y | Y | |
SET RESULT SETS | Y | Y | Y | |
SET SCHEMA | Y | Y | ||
SET TRANSACTION | Y | Y | Y | |
SET variable | Y | Y | Y | |
SIGNAL | Y | Y | Y | |
UPDATE | Y | |||
VALUES | ||||
VALUES INTO | Y | Y | ||
WHENEVER | Y1 | Y | Y | Y |