NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-44
Considerations—COMMENT
Considerations—COMMENT
Authorization requirements
To use COMMENT on a collation, column, table, or view you must be a generalized
owner of the table or view. To use COMMENT on an index, you must be a
generalized owner of the underlying table. COMMENT also requires authority to
write to the affected catalogs.
Only one DDL statement can operate on a given SQL object (or partition of an SQL
object) at a time. An error occurs if you attempt to execute a COMMENT statement
while another process is executing a DDL operation on the same object. The specific
error depends on the DDL operation involved and the phase of the operation at
which the conflict occurs. (See DDL (Data Definition Language) Statements
on
page D-19 for more information.)
Deleting comments
To delete a comment, replace all existing comments with a comment that consists of
an empty string. For example:
COMMENT ON VIEW PERSNL.MGRLIST IS "" CLEAR;
Storage and access to comments
SQL stores comments as rows in the COMMENTS catalog table. You access them
by querying the table. Each new comment for an object is stored as a row with a
sequence number one greater than the highest existing sequence number for a
comment on that object.
An object can have 10,000 comments.
Examples—COMMENT
The following statement adds a comment about a constraint:
COMMENT ON CONSTRAINT DATE_ASSRTN ON SALES.ORDERS
IS "Dates are stored as yymmdd.";
The following statement replaces all comments on a table with a new comment:
COMMENT ON TABLE INVENT.PARTLOC
IS "This table is partitioned LOC_CODE."
CLEAR;
The following statement displays comments and help text for a table:
SELECT * FROM SALES.COMMENTS
WHERE OBJNAME = "\SYS1.$VOL1.SALES.PARTS";