Oracle® Database SQL Reference 10g Release 1 (10.1) Part Number B10759-01 |
|
|
View PDF |
Purpose
Use the COMMENT
statement to add a comment about a table, view, materialized view, or column into the data dictionary.
To drop a comment from the database, set it to the empty string ' '.
See Also:
|
Prerequisites
The object about which you are adding a comment must be in your own schema or:
You must have COMMENT
ANY
TABLE
system privilege to add a comment to a table, view, or materialized view.
You must have the COMMENT
ANY
INDEXTYPE
system privilege to add a comment to an indextype.
You must have the COMMENT
ANY
OPERATOR
system privilege to add a comment to an operator.
Syntax
Semantics
Specify the schema and name of the table or materialized view to be commented. If you omit schema
, then Oracle Database assumes the table or materialized view is in your own schema.
Note: In earlier releases, you could use this clause to create a comment on a materialized view. You should now use theCOMMENT ON MATERIALIZED VIEW clause for materialized views. |
Specify the name of the column of a table, view, or materialized view to be commented. If you omit schema
, then Oracle Database assumes the table, view, or materialized view is in your own schema.
You can view the comments on a particular table or column by querying the data dictionary views USER_TAB_COMMENTS
, DBA_TAB_COMMENTS
, or ALL_TAB_COMMENTS
or USER_COL_COMMENTS
, DBA_COL_COMMENTS
, or ALL_COL_COMMENTS
.
Specify the name of the operator to be commented. If you omit schema
, then Oracle Database assumes the operator is in your own schema.
You can view the comments on a particular operator by querying the data dictionary views USER_OPERATOR_COMMENTS
, DBA_OPERATOR_COMMENTS
, or ALL_OPERATOR_COMMENTS
.
Specify the name of the indextype to be commented. If you omit schema
, then Oracle Database assumes the indextype is in your own schema.
You can view the comments on a particular indextype by querying the data dictionary views USER_INDEXTYPE_COMMENTS
, DBA_INDEXTYPE_COMMENTS
, or ALL_INDEXTYPE_COMMENTS
.
Specify the name of the materialized view to be commented. If you omit schema
, then Oracle Database assumes the materialized view is in your own schema.
You can view the comments on a particular materialized view by querying the data dictionary views USER_MVIEW_COMMENTS
, DBA_MVIEW_COMMENTS
, or ALL_MVIEW_COMMENTS
.
Specify the text of the comment. Please refer to "Text Literals " for a syntax description of 'text'
.
Example
To insert an explanatory remark on the job_id
column of the employees
table, you might issue the following statement:
COMMENT ON COLUMN employees.job_id IS 'abbreviated job title';
To drop this comment from the database, issue the following statement:
COMMENT ON COLUMN employees.job_id IS ' ';