COMMENT Syntax Elements (Comment-Placing Form) - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™
object_kind_1
A mandatory database object kind specification.
The valid specifications for object_kind_1 are not all database objects. Triggers and views, for example, are definitions of actions rather than database objects.
You must specify the following database object kinds to place a comment for the kind of object they represent:
  • COLUMN
  • FUNCTION
  • GLOP SET
  • MACRO
  • MAP
  • METHOD
  • PROCEDURE
  • PROFILE
  • ROLE
  • TRIGGER
  • TYPE
  • VIEW
object_kind_2
An optional database object kind specification.
For a join index, do not specify an object kind.
You can specify the following database object kinds to retrieve a comment for the kind of object, but these keywords are optional.
  • DATABASE
  • FILE

    If you do not specify FILE for a user-installed file (UIF), you must specify the database name.

  • TABLE
  • USER
database_name
The containing database for object_name if it is not contained by the current database or user.
user_name
The containing user for object_name if it is not contained by the current database or user.
comment
A description of the object.
Maximum string length is 255 characters from any supported client character sets.
An existing string can be changed by specifying a new string.
If you do not specify a string, any string previously stored is returned.
object_name
The name of the object to which you want to add a comment. You can add a comment to the following objects:
  • Parameter in a macro, SQL procedure, or user-defined function.
  • Column in a user base table or view.
  • Specific function, macro, file, profile, role, SQL procedure, base table, trigger, or view name contained by a database or user.
  • Database or user.
  • UDT.

    You can add a comment to a particular attribute of a structured UDT by specifying database_name.udt_name.attribute_name.

    The maximum size for attribute_name is 128 Unicode characters.

  • Method.

    If you specify a method, you must use its specific method name.

  • GLOP set.

    If no object kind keyword precedes the object name, then the database attempts to deduce the object from the level of qualification in the name. Use the fully qualified name if there is any ambiguity.

    Let x.y.z indicate the qualification hierarchy, with x being the highest, such as database or user, and z the lowest, such as parameter or attribute.

The following table shows the hierarchies for object_name.
Hierarchy level Object implied
x
  • database
  • user
x.y
  • base table
  • error table
  • GLOP set
  • hash index
  • join index
  • macro
  • profile
  • role
  • procedure
  • trigger
  • UDF
  • view

    within database x or user x.

x.y.z
  • macro parameter
  • procedure parameter
  • structured UDT attribute
  • table column
  • UDF parameter
  • view column

    within base table, error table, GLOP set, hash index, join index, macro, profile, role, procedure, trigger, UDF, or view y which, in turn, is within database x or user x.