The LABEL ON statement adds or replaces labels in the catalog descriptions of tables, views, aliases, packages, or columns.
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
The privileges held by the authorization ID of the statement must include at least one of the following:
The authorization ID of the statement has the ALTER privilege on the table, view or package when:
The authorization ID of the statement has the ALTER privilege on an alias when:
>>-LABEL ON----------------------------------------------------->
>-----+--+-ALIAS--alias-name------------------------------+---IS--string-constant------------+>
| +-COLUMN--+-table-name.column-name-+---+------+--+ |
| | '-view-name.column-name--' '-TEXT-' | |
| | (1) | |
| +-PACKAGE-------package-name---------------------+ |
| '-TABLE--+-table-name-+--------------------------' |
| '-view-name--' |
| .-,-----------------------------------. |
| .-COLUMN-. V | |
+-+--------+----+-table-name-+---(-----column-name--IS--string-constant---+---)--------+
| '-view-name--' |
| .-,-----------------------------------------. |
| .-COLUMN-. V | |
'-+--------+----+-table-name-+---(-----column-name--TEXT--IS--string-constant---+---)--'
'-view-name--'
>--------------------------------------------------------------><
Notes:
|
The label for a column heading consists of three 20-byte segments. Interactive SQL, the Query/400 program, DB2 UDB Query Manager for AS/400, and other products can display or print each 20-byte segment on a separate line. If the label for a column contains mixed data, each 20-byte segment must be a valid mixed data character string. The shift characters must be paired within each 20-byte segment.
Column headings are used when displaying or printing query results. The first column heading is displayed or printed on the first line, the second column heading is displayed or printed on the second line, and the third column heading is displayed or printed on the third line. The column headings can be up to 60 bytes in length, where the first 20 bytes is the first column heading, the second 20 bytes is the second column heading, and the third 20 bytes is the third column heading. Blanks are trimmed from the end of each 20-byte column heading.
All 60 bytes of column heading information are available in the catalog view SYSCOLUMNS; however, only the first column heading is returned in an SQLDA on a DESCRIBE or DESCRIBE TABLE statement.
Column text is not returned on a DESCRIBE or DESCRIBE TABLE statement. When the database manager changes the column heading information in a record format description that is shared, the change is reflected in all files sharing the format description. To find out if a file shares a format with another file, use the RCDFMT parameter on the CL command, Display Database Relations (DSPDBR).
LABEL ON COLUMN CORPDATA.DEPARTMENT.DEPTNO
IS 'DEPARTMENT NUMBER'
LABEL ON COLUMN CORPDATA.DEPARTMENT.DEPTNO
IS 'Department Number'
LABEL ON PACKAGE CORPDATA.PAYROLL
IS 'Payroll Package'