Supported DCL Statements
You can use the following SQL DCL statements in a stored procedure.
- GIVE
- GRANT (all forms)
- GRANT CONNECT THROUGH
- GRANT LOGON
- REVOKE (all forms)
- REVOKE CONNECT THROUGH
- REVOKE LOGON
Transaction Mode Impact on DCL Statements
The behavior of DCL statements specified in stored procedures at runtime depends on the transaction mode of the Teradata session in which the procedure is created.
- A DCL statement specified within an explicit (user-defined) transaction in a stored procedure in Teradata transaction mode must be the last statement in that transaction. Otherwise, a runtime exception (SQLCODE: 3932, SQLSTATE: ‘T3932’) is raised.
- When performing a stored procedure in ANSI transaction mode, each DCL statement specified in the procedure body must be followed by a COMMIT WORK statement. Otherwise, a runtime exception (SQLCODE: 3722, SQLSTATE: ‘T3722’) is raised.