Skip Headers

Oracle9i SQL Reference
Release 2 (9.2)

Part Number A96540-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page Go to next page
View PDF

COMMENT

Purpose

Use the COMMENT statement to add a comment about a table, view, materialized view, or column into the data dictionary.

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.

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:

Syntax

comment::=

Text description of statements_420.gif follows
Text description of comment


Semantics

TABLE Clause

Specify the schema and name of the table, view, or materialized view to be commented. If you omit schema, then Oracle assumes the table, view, or materialized view is in your own schema.

COLUMN Clause

Specify the name of the column of a table, view, or materialized view to be commented. If you omit schema, then Oracle assumes the table, view, or materialized view is in your own schema.

IS 'text'

Specify the text of the comment.

See Also:

"Text Literals" for a syntax description of 'text'

OPERATOR Clause

Specify the name of the operator to be commented. If you omit schema, then Oracle assumes the operator is in your own schema.

INDEXTYPE Clause

Specify the name of the indextype to be commented. If you omit schema, then Oracle assumes the indextype is in your own schema.

Example

Creating Comments: 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 ' ';