Previous Topic Next topic Print topic


LABEL ON

The LABEL ON statement adds or replaces descriptive text labels in the system catalog for the current location. These text labels describe tables, views, aliases, or columns existing at the current location.

Invocation

LABEL ON is an executable command that can be issued interactively, embedded in a host language, or dynamically prepared.

Authorization

To execute the LABEL ON command, users must possess either DBADM authority on the database, overall SYSADM or SYSCTRL authority for the location, or be the owner of the table, view, or alias affected.

If the statement is embedded in an application program, the privilege set is the privileges that are held by the authorization ID of the owner of the plan or package. If the statement is dynamically prepared, the privilege set is determined by the DYNAMICRULES behavior in effect (run, bind, define, or invoke.)

Syntax

LABEL ON
{ 
    TABLE {table-name | view-name} | 
    ALIAS alias-name | 
    COLUMN {table-name.column-name | view-name.column-name}
}
    IS string-constant

Use the following syntax of the LABEL ON command when labeling more than one column per statement.

LABEL ON {table-name | view-name} 
    (column-name IS string-constant[,...])

Parameters:

table-name or view-name Identifies the table or view described by the label (string-constant).
alias-name Identifies the alias to which the comment (string-constant) applies.
column-name Preceded with an optional qualifier of [table-name.] or [view-name.], identifies a column to which the comment (string-constant) applies.
string-constant Preceded by the keyword IS, any character string constant (up to 30 bytes in length) enclosed in quotes.

Description

Choose one of the following object keywords (with corresponding object name) for labeling in the system catalog.

TABLE

Keyword indicating that a table or view is being labeled. The identified object must exist at the current location. The string-constant specified in the LABEL ON command is recorded in the SYSIBM.SYSTABLES catalog table, in the LABEL column of the row describing the table or view. table-name must not identify a declared temporary table.

ALIAS

Keyword indicating that an alias is being labeled. The alias identified must exist at the current location. The string-constant specified in the LABEL ON command is recorded in the SYSIBM.SYSTABLES catalog table, in the LABEL column of the row describing the alias.

COLUMN

Keyword indicating that a column is being labeled. The column identified must belong to a table or view existing at the current location. The string-constant specified in the LABEL ON command is recorded in the SYSIBM.SYSCOLUMNS catalog table -- in the LABEL column of the row describing the column. The column name must not identify a column of a declared temporary table.

Previous Topic Next topic Print topic