COMMENT (Returning Form) | Teradata Vantage - COMMENT (Returning Form) - Teradata Vantage - Analytics Database

SQL Stored Procedures and Embedded SQL

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Publication Date
June 2022
Content Type
SQL Reference
Publication ID
B035-1148-172K
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
frc1628111662093.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
ft:sourceId
dita
dita:id
rjx1472253414573
lifecycle
latest
Product Category
Teradata Vantageā„¢

Returns the comment (if any) that belongs to an object.

The returning form of COMMENT returns data.

ANSI Compliance

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

Required Privileges

None.

Invocation

Executable.

Embedded SQL only.

Syntax

COMMENT [ON] object_kind object_reference
  INTO [:] host_variable_name
  [ [ INDICATOR ] :host_indicator_name ]

Syntax Elements

object_kind
One of these objects:
  • COLUMN
  • DATABASE
  • FUNCTION
  • MACRO
  • PROCEDURE
  • PROFILE
  • ROLE
  • TABLE
  • TRIGGER
  • USER
  • VIEW
object_reference
One of these object references:
  • column name
  • database name
  • macro name
  • procedure name
  • profile name
  • role name
  • table name
  • trigger name
  • user name
  • user-defined function name
  • view name
host_variable_name
The name of the host variable into which the comment is to be placed.
The preceding COLON is optional; however, its use is strongly recommended.
Blanks before and after the colon are optional.
The rules for the name follow the client programming language conventions.
host_indicator_name
The name of the host indicator variable.

Usage Notes

  • The data type of host_variable_name must be VARCHAR(255).
  • If no comment exists for the specific object, host_indicator_name returns NULL.
  • Although the COMMENT statement returns only one data value (in effect, a single row containing a single column), you can use a selection cursor with a static COMMENT statement. Use the same procedure for the cursor as for a static selection cursor.
  • If you execute a dynamic COMMENT statement, then you must use a dynamic cursor because data is returned. The same procedure is followed as with dynamic selection.
  • If you use COMMENT with a cursor or as a dynamic SQL statement, then you must omit the INTO clause.