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

SQL Data Manipulation Language

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
2024-12-13
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
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 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.