COMMENT Examples | SQL Statements | Teradata Vantage - COMMENT Examples - 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-10-04
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantageā„¢

Example: Retrieving a Comment

Suppose you have placed the following comment describing the name column in the employee table:

COMMENT ON COLUMN employee.name
  IS 'Employee name, last name followed by first initial';

The following request retrieves this comment:

COMMENT ON COLUMN employee.name;

The request returns the comment string as created by the previous request:

Employee name, last name followed by first initial

Note that because the object kind for this request is COLUMN, you must specify the keyword COLUMN when you code it.

Example: Placing a Comment

Suppose you have defined a hash index named ord_hidx defined on the orders table, which is contained in the accounting database.

Because the object kind for this request is TABLE, representing a hash index, you are not required to specify TABLE in the request.

You could type the following comment-placing COMMENT request to define a comment on the hash index ord_hidx:

COMMENT accounting.ord_hidx AS 'hash index on Orders';

Then if you were to perform the following comment-retrieving COMMENT request, the text that follows would be returned to you:

COMMENT accounting.ord_hidx;
hash index on orders