All Products
Search
Document Center

Comments on schema objects and non-schema objects

Last Updated: Jun 18, 2021

You can execute the COMMENT statement to associate comments with schema objects (tables, views, materialized views, operators, and index types) or non-schema objects (editions). You can also create comments for columns of table schema objects. Comments associated with schema objects and non-schema objects are stored in your data dictionary.

Syntax:
COMMENT ON {TABLE table | COLUMN column | INDEXTYPE indextype 
    | OPERATOR operator | VIEW view} IS string

For example, you want to associate a comment with the table named user:

COMMENT ON TABLE test.user is "This is a table that records user information";

For example, you want to create a comment for the user_name column:

COMMENT ON COLUMN test.user.user_name is "The user names are recorded";