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

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

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

For information about the comment-placing form of this SQL statement, see “COMMENT (Comment-Placing Form)” in Teradata Vantage™ - SQL Data Definition Language Detailed Topics , B035-1184 .

Required Privileges

None.

Privileges Granted Automatically

None.

ANSI Compliance

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

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.