Was this helpful?
COMMENT ON
Valid in: SQL, ESQL
The COMMENT ON statement creates a comment on a table, view, or column.
To display the comments, use the HELP COMMENT statement.
To delete the comments, issue the COMMENT ON statement and specify an empty string (' '). Comments on tables and views are deleted when the table or view is dropped.
To query comments on a certain table, use the iidbms_comment system catalog.
This statement has the following format:
[EXEC SQL] COMMENT ON
            TABLE [schema.]name |
            VIEW [schema.]name |
            COLUMN [schema.]tablename.column_name
              IS 'remark_text'
name
Specifies the name of the object for which the comment is defined.
For COMMENT ON VIEW the name must be the name of a view.
For COMMENT ON TABLE the name can be the name of a table or view.
remark_text
Defines the text of the comment. The text string must be surrounded by single quotes.
Limits: The maximum length for a comment is 1600 characters.
Embedded Usage
You cannot use host language variables in an embedded COMMENT ON statement.
Permissions
You can create comments only on tables or views that you own.
Locking
The COMMENT ON statement locks the iidbms_comment system catalog and takes an exclusive lock on the table on which the comment is being created.
Related Statements
HELP
Last modified date: 01/30/2023