Oracle8i SQL Reference
Release 2 (8.1.6)

A76989-01

Library

Product

Contents

Index

Prev Up Next

SQL Statements (continued), 3 of 6


COMMENT

Syntax


Purpose

To add a comment about a table, view, snapshot, or column into the data dictionary. See also "Comments".

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. For information on these views, see Oracle8i Reference.

To drop a comment from the database, set it to the empty string ' '.

Prerequisites

The table, view, or snapshot must be in your own schema or you must have COMMENT ANY TABLE system privilege.

Keywords and Parameters

TABLE 

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

COLUMN 

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

IS 'text

is the text of the comment. See the syntax description of 'text' in "Text".  

Example

To insert an explanatory remark on the NOTES column of the SHIPPING table, you might issue the following statement:

COMMENT ON COLUMN shipping.notes
    IS 'Special packing or shipping instructions'; 

To drop this comment from the database, issue the following statement:

COMMENT ON COLUMN shipping.notes IS ' '; 

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index