Previous Topic

Next Topic

Comment On

Valid in: SQL, ESQL

The Comment On statement creates a comment on a table, view, or column.

Previous Topic

Next Topic

Syntax

The Comment On statement has the following format:

[EXEC SQL] COMMENT ON
              TABLE [schema.]table_name | COLUMN [schema.]table_name.column_name
              IS remark_text

Previous Topic

Next Topic

Description

The Comment On statement stores comments about 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.

Previous Topic

Next Topic

Embedded Usage

You cannot use host language variables in an embedded Comment On statement.

Previous Topic

Next Topic

Permissions

You can only create comments on tables or views that you own.

Previous Topic

Next Topic

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.

Previous Topic

Next Topic

Related Statements

Help

Previous Topic

Next Topic

Examples: Comment On

The following examples store comments about a table:

  1. Create a comment on the authors table.

    comment on table authors is
    'It was the best of times, it was the worst
    of times. It was...'

  2. Delete comments on the authors table.

    comment on table authors is '';

  3. Comment on column, name, in the authors table.

    comment on column authors.name is 'Call me Ishmael';


© 2007 Ingres Corporation. All rights reserved.