Contents IndexCLOSE statement COMMIT statement

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 43. Watcom-SQL Statements
      COMMENT statement

Function

To store a comment in the system tables for a database object.

Syntax

     COMMENT ON
          {
               COLUMN [ owner.]table-name.column-name
              | FOREIGN KEY [ owner.]table-name.role-name
              | INDEX [ owner.]index-name
              | LOGIN integrated_login_id
              | PUBLICATION[ owner.]publication-name
              | PROCEDURE [ owner.]procedure-name
              | SUBSCRIPTION [ owner.]subscription-name
              | TABLE [ owner.]table-name
              | USER userid
              | TRIGGER [ owner.]trigger-name
              | VIEW [ owner.]view-name
          }
          IS comment

Parameters

     comment:
          {string| NULL}

Usage

Anywhere.

Permissions

Must either be the owner of the database object being commented, or have DBA authority.

Side effects

Automatic commit.

Description

Several system tables have a column named Remarks that allows you to associate a comment with a database item (SYSUSERPERM, SYSTABLE, SYSCOLUMN, SYSINDEX, SYSLOGIN, SYSFOREIGNKEY, SYSPROCEDURE, SYSTRIGGER). The COMMENT ON statement allows you to set the Remarks column in these system tables. A comment can be removed by setting it to NULL.

When adding a comment to an index or trigger, the owner is the owner of the table on which the index or trigger is defined.

Examples

The following examples show how to add and remove a comment.

Contents IndexCLOSE statement COMMIT statement