COMMENT Statement | SQL Statements | Teradata Vantage - 17.05 - COMMENT (Comment-Retrieving Form) - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1146-175K
Language
English (United States)

Retrieves a previously placed comment on a database object or definition.

For information about the comment-placing form of this SQL statement, see Teradata Vantage™ - SQL Data Definition Language Detailed Topics , B035-1184 .

ANSI Compliance

COMMENT is a Teradata extension to the ANSI SQL:2011 standard.

Required Privileges

None.

Privileges Granted Automatically

None.

Rules for Using COMMENT (Comment-Retrieving Form)

These rules apply to using the comment-retrieving form of the COMMENT statement:
  • COMMENT (Comment-Retrieving Form) is treated as a DML statement for transaction processing, so it can be used in 2PC session mode. For a brief description of the two-phase commit protocol, see Teradata Vantage™ - Database Introduction, B035-1091.

    You can specify a COMMENT (Comment-Retrieving Form) request at any point within the boundaries of an explicit transaction in Teradata session mode.

  • To retrieve a comment, do not specify a comment string following the specification of the object name.
    IF you … THEN the system …
    specify a comment string does one of the following things:
    • If the specified object has no existing comment, the database places the specified comment string for the object in the data dictionary.
    • If the specified object has an existing comment, the database replaces the existing comment in the data dictionary with the newly specified string.
    do not specify a comment string does one of the following things:
    • If the specified object has no existing comment, the database returns a null.
    • If the specified object has an existing comment, the database returns the text of that comment as it is stored in the data dictionary.
  • You cannot specify a containing database or user name if the object kind you specify is GROUP.