Usage Considerations for DDL Statements in Procedures - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™
  • You can use DDL COMMENT statements in a procedure. You cannot specify DML COMMENT statements, which are restricted to embedded SQL applications, to fetch the comments for database objects, columns of a table, and parameters.
  • The queue table form of CREATE TABLE (see CREATE TABLE (Queue Table Form)) cannot run in a procedure. All other forms of the CREATE TABLE statement are valid.
  • If a CREATE VOLATILE TABLE statement is included in a procedure, the volatile table is created in the database of the user. If an object with the same name already exists in that database, the result is a runtime exception.

    DML statements within a procedure referencing the volatile table must either have the logon database of the user as the qualifier, or not have any qualifying database name.

  • A CREATE DATABASE or CREATE USER statement in a procedure must contain the FROM clause. The statement result depends on the FROM clause as indicated by the following table.
    Condition Result
    Procedure contains a FROM clause. The specified database is the immediate owner of the user or database created.
    Procedure does not contain a FROM clause. The system reports an SPL compilation error during procedure creation.

    If you specify either a CREATE USER statement or a CREATE DATABASE statement without a FROM clause as a dynamic SQL statement within a procedure, the same error is reported as a runtime exception during procedure execution.