LABEL ON

The LABEL ON statement adds or replaces labels in the catalog descriptions of tables, views, aliases, packages, or columns.

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 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:

Syntax



>>-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:


  1. The keyword PROGRAM can be used as a synonym for PACKAGE.


Description

ALIAS
Indicates that the label is for an alias. Labels on aliases are implemented as AS/400 object text.

alias-name
Identifies the alias to which the label applies. The name must identify an alias that exists at the current server.

COLUMN
Indicates that the label is for a column. Labels on columns are implemented as AS/400 column headings or column text. Column headings are used when displaying or printing query results.

table-name.column-name  or  view-name.column-name
Identifies the column, which is qualified by the name of the table or view in which it appears. The column-name must identify a column of the specified table or view that exists at the current server.

TEXT
Indicates that OS/400 column text is specified. If TEXT is omitted, a column heading is specified.

PACKAGE
Indicates that the label is for a package. Labels on packages are implemented as AS/400 object text.

package-name
Identifies the package to which the label applies. The name must identify a package that exists at the current server.

TABLE
Indicates that the label is for a table or a view. Labels on tables or views are implemented as AS/400 object text.

table-name  or  view-name

Identifies the table or view on which you want to add a label. The table-name or view-name must identify a table or view that exists at the current server.

IS
Introduces the label you want to provide.

string-constant
Can be any SQL character-string constant of up to either 50 bytes in length for tables, views, aliases, SQL packages, or column text, or 60 bytes in length for column headings. The constant may contain single-byte and double-byte characters.

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.

Notes

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).

Examples


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]