COMMENT statement

Description

Stores a comment in the system tables for a database object.

Syntax

COMMENT ONCOLUMN [ owner.]table-name.column-name
| DBSPACE dbspace-name
| EVENT event-name
| EXTERNAL ENVIRONMENT environment-name
| EXTERNAL OBJECT object-name
| FOREIGN KEY [owner.]table-name.role-name
| INDEX [ [owner.]table.]index-name
| INTEGRATED LOGIN integrated-login-id
| JAVA CLASS java-class-name
| JAVA JAR java-jar-name
| KERBEROS LOGIN  “client-Kerberos-principal”
| LOGIN POLICY policy-name
| MATERIALIZED VIEW [owner.]materialized-view-name
| PROCEDURE [owner.]table-name
| SERVICE web-service-name
| TABLE [ owner.]table-name
| TRIGGER [[ owner.]table-name.]trigger-name 
| USER userid
| VIEW [ owner.]view-name }
IS comment

Parameters

comment:

{ string | NULL }

environment-name:

JAVA | PERL | PHP | CLR | C_ESQL32 | C_ESQL64 | C_ODBC32 | C_ODBC64

Examples

Example 1

Adds a comment to the Employees table:

COMMENT
ON TABLE Employees 
IS "Employee information"

Example 2

Removes the comment from the Employees table:

COMMENT
ON TABLE Employees 
IS NULL

Usage

The COMMENT statement allows you to set a remark (comment) for an object in the database. The COMMENT statement updates remarks listed in the ISYSREMARK system table. You can remove a comment by setting it to NULL. For a comment on an index or trigger, the owner of the comment is the owner of the table on which the index or trigger is defined.

The COMMENT ON DBSPACE, COMMENT ON JAVA JAR, and COMMENT ON JAVA CLASS statements allow you to set the Remarks column in the SYS.ISYSREMARK system table. The comment can be removed by setting it to NULL.

You cannot add comments for local temporary tables.

The environment-name is one of JAVA, PERL, PHP, CLR, C_ESQL32, C_ESQL64, C_ODBC32, or C_ODBC64.

Standards

Permissions

Must either be the owner of the database object being commented, or have DBA authority. (You must have DBA authority to issue this statement with the DBSPACE clause.)