LABEL

The LABEL statement adds or replaces labels in the descriptions of tables, views, aliases, or columns in the catalog at the current server.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.

Authorization

The privilege set that is defined below must include at least one of the following:

  • Ownership of the table, view, or alias
  • DBADM authority for its database (tables only)
  • SYSADM or SYSCTRL authority
  • Start of changeSystem DBADMEnd of change

If the database is implicitly created, the database privileges must be on the implicit database or on DSNDB04.

Privilege set: If the statement is embedded in an application program, the privilege set is the privileges that are held by 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) and is summarized in Table 1. (For more details on these behaviors, including a list of the DYNAMICRULES bind option values that determine them, see Authorization IDs and dynamic SQL.)

Syntax

>>-LABEL ON--+-+-TABLE--+-table-name-+--------------+--IS--string-constant-+-><
             | |        '-view-name--'              |                      |   
             | +-ALIAS--alias-name------------------+                      |   
             | '-COLUMN--+-table-name.column-name-+-'                      |   
             |           '-view-name.column-name--'                        |   
             |                    .-,--------------------------------.     |   
             |                    V                                  |     |   
             '-+-table-name-+--(----column-name--IS--string-constant-+--)--'   
               '-view-name--'                                                  

Description

TABLE table-name or view-name
Identifies the table or view to which the label applies. The name must identify a table or view that exists at the current server. table-name must not identify a declared temporary table. The label is placed into the LABEL column of the SYSIBM.SYSTABLES catalog table for the row that describes the table or view.
ALIAS alias-name
Identifies the alias to which the label applies. The name must identify an alias that exists at the current server. The label is placed in the LABEL column of the SYSIBM.SYSTABLES catalog table for the row that describes the alias.
COLUMN table-name.column-name or view-name.column-name
Identifies the column to which the label applies. The name must identify a column of a table or view that exists at the current server. The name must not identify a column of a declared temporary table. The label is placed in the LABEL column of the SYSIBM.SYSCOLUMNS catalog table in the row that describes the column.
Do not use TABLE or COLUMN to define a label for more than one column in a table or view. Give the table or view name and then, in parentheses, a list in the form:
   column-name IS string-constant,
   column-name IS string-constant,...
See Example 2 below.

The column names must not be qualified, each name must identify a column of the specified table or view, and that table or view must exist at the current server.

IS
Introduces the label you want to provide.
string-constant
Can be any SQL character string constant of up to 30 bytes in length.

Examples

Example 1: Enter a label on the DEPTNO column of table DSN8A10.DEPT.
   LABEL ON COLUMN DSN8A10.DEPT.DEPTNO
     IS 'DEPARTMENT NUMBER';
Example 2: Enter labels on two columns in table DSN8A10.DEPT.
   LABEL ON DSN8A10.DEPT
    (MGRNO IS 'EMPLOYEE NUMBER FOR THE MANAGER',
     ADMRDEPT IS 'ADMINISTERING DEPARTMENT');