Use this statement to store a comment for a database object in the system tables.
COMMENT ON
{
COLUMN [ owner.]table-name.column-name
| EVENT event-name
| FOREIGN KEY [ owner.]table-name.role-name
| INDEX [ [ owner.] table.]index-name
| JAVA CLASS java-class-name
| JAVA JAR java-jar-name
| INTEGRATED LOGIN integrated-login-id
| PROCEDURE [ owner.]procedure-name
| SERVICE web-service-name
| TABLE [ owner.]table-name
| TRIGGER [ [ owner.]tablename.]trigger-name
| USER userid
| VIEW [ owner.]view-name
| MATERIALIZED VIEW [ owner.]materialized-view-name
| PRIMARY KEY ON [ owner.]table-name
| KERBEROS LOGIN "client-Kerberos-principal"
}
IS comment
comment : string | NULL
The COMMENT statement allows you to set a remark (comment) for an object in the database. The COMMENT statement updates remarks listed in the ISYSREMARKS 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.
You cannot add comments for local temporary tables.
Must either be the owner of the database object being commented, or have DBA authority.
Automatic commit.
SQL/2003 Vendor extension.
The following examples show how to add and remove a comment.
Add a comment to the Employees table.
COMMENT ON TABLE Employees IS 'Employee information';
Remove the comment from the Employees table.
COMMENT ON TABLE Employees IS NULL;
To view the comment set for an object, use a SELECT statement similar to the following. This example retrieves the comment set for the ViewSalesOrders view in the SQL Anywhere sample database.
SELECT remarks FROM SYSTAB t, SYSREMARK r WHERE t.object_id = r.object_id AND t.table_name = 'ViewSalesOrders';