15.00 - Rules for Using COMMENT - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Rules for Using COMMENT

The following rules apply to using the COMMENT statement:

  • The comment‑placing form of COMMENT is treated as a DDL statement for transaction processing, so it cannot be used in 2PC session mode (see Introduction to Teradata for a brief description of the two‑phase commit protocol).
  • If you specify a COMMENT request within the boundaries of an explicit transaction in Teradata session mode, it must be the last request in that transaction.

  • COMMENT ON FUNCTION works for the following UDF types.
  • Simple external UDFs
  • Table UDFs
  • SQL UDFs
  • COMMENT ON TYPE works for both UDT types.
  • Distinct
  • Structured
  • COMMENT ON METHOD works for all of the following method types.
  • Constructor
  • Instance
  • Mutator
  • You must specify the specific method name for any method on which you want to place a comment.

    The following table explains the differences between the comment placing and comment returning forms of COMMENT.

     

    IF you …

    THEN Teradata Database …

    specify a comment string

    does one of the following:

  • If the specified object has no existing comment, Teradata Database places the specified comment string for the object in the data dictionary.
  • If the specified object has an existing comment, Teradata Database replaces the existing comment in the data dictionary with the newly specified comment string.
  • do not specify a comment string

    does one of the following:

  • If the specified object has no existing comment, Teradata Database returns a null.
  • If the specified object has an existing comment, Teradata Database returns the text of that comment as it is stored in the data dictionary.