COMMENT statement

Description

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

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 comment for an object in the database. The COMMENT statement updates remarks in the ISYSREMARK system table. You can remove a comment by setting it to NULL. The owner of a comment on an index or trigger 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. Remove a comment by setting it to NULL.

You cannot add comments for local temporary tables.

NoteMaterialized views are only supported for SQL Anywhere tables in the IQ catalog store.

Standards

Permissions

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