Unsupported DDL Statements in Procedures | CREATE PROCEDURE | Vantage - 17.10 - Unsupported DDL Statements in SQL Procedures - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1184-171K
Language
English (United States)

You cannot specify the following DDL statements in an SQL procedure.

  • ALTER CONSTRAINT
  • ALTER METHOD
  • ALTER PROCEDURE
  • ALTER TYPE
  • BEGIN QUERY LOGGING
  • CREATE CONSTRAINT
  • CREATE GLOP SET
  • CREATE METHOD
  • CREATE PROCEDURE
  • CREATE TABLE (queue and trace table forms)
  • CREATE TYPE (all forms)
  • DATABASE
  • DROP CONSTRAINT
  • DROP GLOP SET
  • DROP TYPE
  • END QUERY LOGGING
  • FLUSH QUERY LOGGING
  • HELP (all forms)
  • REPLACE METHOD
  • REPLACE PROCEDURE
  • REPLACE QUERY LOGGING
  • REPLACE TYPE
  • SET QUERY_BAND … FOR SESSION
  • SET ROLE
  • SET SESSION (all forms)
  • SET TIME ZONE
  • SHOW (all forms)

You also cannot specify any DDL statements in an SQL procedure that administer any aspect of any row-level security constraints.

Note that these statements are restricted from being specified in CREATE PROCEDURE or REPLACE PROCEDURE DDL SQL text, not from being invoked as dynamic SQL from within a procedure definition. Dynamic SQL requests are parsed and bound at run time, not when the procedure that contains them is compiled, so it does not follow the same rules as must be observed when SQL requests are executed from within a compiled procedure. Any SQL statement that can be invoked as standalone dynamic SQL can also be invoked as dynamic SQL from within a procedure definition.