COMMENT ON statement 

The COMMENT ON statement creates, alters, or drops a comment for a database object stored in the catalog.

Syntax

<comment on statement> ::= COMMENT ON <object spec> IS <comment>

<object spec> ::= see explanation
<comment> ::= <string literal> | <parameter name>

string literal, parameter name

Explanation

Comments can be specified for the following database objects:

<object spec> ::=

Explanation

COLUMN <table name>.<column name>

table name, column name

The column must exist in the specified table. The current user must be the owner of the table.
The comment for this column can be interrogated by selecting the system table DOMAIN.
COLUMNS.

DBPROC[EDURE] <dbproc name>

dbproc name

dbproc name must identify an existing database procedure whose owner is the current user. A comment is stored for the DB procedure. The comment can be interrogated by selecting the system table DOMAIN. DBPROCEDURES.

DOMAIN <domain name>

domain name

domain name must specify a domain of the current user. The comment for this domain can be interrogated by selecting the system table DOMAIN. DOMAINS.

FOREIGN KEY <table name>.<referential constraint name>

referential constraint name

referential constraint name must specify a referential CONSTRAINT definition for the specified table of the current owner.
The comment for this referential CONSTRAINT definition can be interrogated by selecting the system table DOMAIN.
FOREIGNKEYS.

INDEX <index name> ON <table name>
INDEX <index name.<column name>

index name

index name must specify an index and column name a column (for which a single-column index exists) in the specified table. The current user must be the owner of the table.
The comment for this index can be interrogated by selecting the system table DOMAIN.
INDEXES.

[PUBLIC] SYNONYM <synonym name>

synonym name

synonym name must specify a synonym of the current user.
If PUBLIC is specified, the synonym must have the PUBLIC attribute.
The comment for this synonym can be interrogated by selecting the system table DOMAIN.
SYNONYMS.

TABLE <table name>

table name

The specified table must identify a base or view table of the current user that is not a temporary table.
The comment for this table can be interrogated by selecting the system table DOMAIN.
TABLES.

TRIGGER <trigger name> ON <table name>

Trigger name

The specified trigger name must identify a trigger of the specified table. The current user must be the owner of the table. A comment is stored for the trigger and can be interrogated by selecting the system table DOMAIN. TRIGGERS.

USER <user name>

user name

The specified user must identify an existing user whose owner is the current user.
The comment for this user can be interrogated by selecting the system table DOMAIN.
USERS.

USERGROUP <usergroup name>

Usergroup name

The specified usergroup must identify an existing usergroup whose owner is the current user.
The comment for this usergroup can be interrogated by selecting the system table DOMAIN.
USERS.

<parameter name>

parameter name

The corresponding variable must contain one of the values listed in the table. The values must be encapsulated in inverted commas.

Example:

'COLUMN <table name>.<column name>'