COMMENT Syntax | SQL Statements | VantageCloud Lake - COMMENT Syntax (Comment-Retrieving Form) - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
{ comment_on_compute_object |
  comment_on_noncompute_object |
  comment_on_datalake_object
} [;]
comment_on_compute_object
COMMENT ON {
  COMPUTE GROUP compute_group |
  COMPUTE MAP compute_map |
  COMPUTE PROFILE compute_profile [ IN [ COMPUTE GROUP ] compute_group ]
} [ 'comment' ]
comment_on_noncompute_object
COMMENT [ON] { object_kind_1 | object_kind_2 }
  [ database_name. | user_name. ] object_name
  [ [ AS | IS ] 'comment' ]
comment_on_datalake_object
COMMENT [ON] [ TD_SERVER_DB.]datalake_name [ 'comment' ]

Syntax Elements

comment_on_compute_object
See the following:
object_kind_1
Required database object kind specification.
The valid specifications for object_kind_1 are not all database objects. Views and triggers, for example, are definitions of actions or conceptual groups rather than database objects.
You must specify the following database object kinds to retrieve a comment for the kind of object they represent.
  • COLUMN
  • FUNCTION
  • GLOP SET
  • GROUP
  • MACRO
  • METHOD
  • PROCEDURE
  • PROFILE
  • ROLE
  • TRIGGER
  • TYPE
  • VIEW
object_kind_2
Optional database object kind specification.
You can specify the following database object kinds to retrieve a comment for the kind of object they represent, but they are optional.
  • DATABASE
  • TABLE
  • USER
  • FILE
The semantics of the COMMENT statement require that if you specify an object kind, you must specify the keyword TABLE for any join index whose comment you want to retrieve; however, because TABLE is not a required object kind specification, you do not have to specify it.
If you omit the object_kind when you retrieve a comment for a file, the object_name must contain the whole path to the file, for example, dbname.uifname.
database_name
user_name
Containing database or user for object_name if not contained by the current database or user.
You cannot specify a database name or user name if object_kind is GROUP.
For the rules to use in naming database objects, see Object Names.
object_name
Name of the object for which a comment is to be retrieved, including:
  • Parameter in a macro, stored procedure, or user-defined function.
  • Column in a user base table, error table, join index, or view.
  • Specific function, macro, profile, role, stored procedure, base table, error table, join index, trigger, or view name contained by a database or user.
  • Database or user.
  • A GLOP set.
If you do not precede the object name with an object kind keyword, the system attempts to deduce the object from the level of qualification in the name. Use the fully-qualified name to avoid ambiguity.
Let x.y.z indicate the qualification hierarchy, with x being the highest, or coarsest grained, level and z the lowest, or most finely grained.
If you specify a hierarchy level of x, the specified object is implied to be one of the following:
  • Database
  • User
If you specify a hierarchy level of x.y, the specified object is implied to be one of the following:
  • Base table
  • Error table
  • GLOP set
  • Join index
  • Macro
  • Profile
  • Role
  • Stored procedure
  • Trigger
  • User-defined function
  • View within database or user x.
If you specify a hierarchy level of x.y.z, the specified object is implied to be one of the following:
  • Macro parameter
  • Stored procedure parameter
  • Table column
  • UDF parameter
  • View column within GLOP set, UDF, macro, stored procedure, profile, role, base table, trigger, or view y contained in database or user x.
TD_SERVER_DB
[Optional] Name of the database where the DATALAKE object is.
datalake_name
Name of the DATALAKE object.