238 lines
14 KiB
HTML
238 lines
14 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="dc.language" scheme="rfc1766" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<meta name="dc.date" scheme="iso8601" content="2005-09-19" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow"/>
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="keywords" content="LABEL statement, LABEL, SQL statements,
|
|
in catalog tables, LABELS, ALIAS clause, in LABEL statement, alias-name,
|
|
COLUMN clause, column-name, TEXT clause, INDEX clause, index-name,
|
|
PACKAGE clause, package-name, SEQUENCE clause, sequence-name, TABLE clause,
|
|
table-name, view-name, IS clause, constant" />
|
|
<title>LABEL</title>
|
|
<link rel="stylesheet" type="text/css" href="ibmidwb.css" />
|
|
<link rel="stylesheet" type="text/css" href="ic.css" />
|
|
</head>
|
|
<body>
|
|
<a id="Top_Of_Page" name="Top_Of_Page"></a><!-- Java sync-link -->
|
|
<script language = "Javascript" src = "../rzahg/synch.js" type="text/javascript"></script>
|
|
|
|
|
|
<a name="labelon"></a>
|
|
<h2 id="labelon"><a href="rbafzmst02.htm#ToC_1163">LABEL</a></h2><a id="idx2885" name="idx2885"></a><a id="idx2886" name="idx2886"></a><a id="idx2887" name="idx2887"></a>
|
|
<a name="label"></a>
|
|
<p id="label">The LABEL statement adds or replaces labels in the catalog descriptions
|
|
of various database objects.</p>
|
|
<a name="wq1631"></a>
|
|
<h3 id="wq1631"><a href="rbafzmst02.htm#ToC_1164">Invocation</a></h3>
|
|
<p>This statement can be embedded in an application program or issued interactively.
|
|
It is an executable statement that can be dynamically prepared.</p>
|
|
<a name="wq1632"></a>
|
|
<h3 id="wq1632"><a href="rbafzmst02.htm#ToC_1165">Authorization</a></h3>
|
|
<p>The privileges held by the authorization ID of the statement must include
|
|
at least one of the following: </p>
|
|
<ul>
|
|
<li>For the table, view, alias, sequence, or package identified in the statement,
|
|
<ul>
|
|
<li>The ALTER privilege on the table, view, alias, sequence, or package, and</li>
|
|
<li>The system authority *EXECUTE on the library containing the table, view,
|
|
alias, sequence, or package</li></ul></li>
|
|
<li>Administrative authority</li></ul>
|
|
<p>To label an index, the privileges held by the authorization
|
|
ID of the statement must include at least one of the following: </p>
|
|
<ul>
|
|
<li>For the index identified in the statement,
|
|
<ul>
|
|
<li>The system authority *OBJALTER on the index, and</li>
|
|
<li>The system authority *EXECUTE on the library containing the index.</li></ul></li>
|
|
<li>Administrative authority</li></ul>
|
|
<p>To label a sequence, the privileges held by the authorization ID of the
|
|
statement must also include at least one of the following: </p>
|
|
<ul>
|
|
<li>*USE authority to the Change Data Area (CHGDTAARA) CL command</li>
|
|
<li>Administrative authority</li></ul>
|
|
<p>The authorization ID of the statement has the ALTER privilege on an alias
|
|
when: </p>
|
|
<ul>
|
|
<li>It is the owner of the alias, or</li>
|
|
<li>It has been granted the system authorities of either *OBJALTER or *OBJMGT
|
|
to the alias</li></ul>
|
|
<p>For information on the system authorities corresponding to SQL privileges,
|
|
see <a href="rbafzmstgnt.htm#eqtablet">Corresponding System Authorities When Checking Privileges to a Table or View</a>, <a href="rbafzmstgntseqp.htm#eqtables">Corresponding System Authorities When Checking Privileges to a Sequence</a>, and <a href="rbafzmstgntpp.htm#eqtablep">Corresponding System Authorities When Checking Privileges to a Package</a>.</p>
|
|
<a name="wq1633"></a>
|
|
<h3 id="wq1633"><a href="rbafzmst02.htm#ToC_1166">Syntax</a></h3>
|
|
<a href="rbafzmstlabelon.htm#synslabel"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
|
|
<a name="wq1634"></a>
|
|
<div class="fignone" id="wq1634">
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn358.htm"
|
|
border="0" /></span><a href="#skipsyn-357"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a>>>-LABEL--ON---------------------------------------------------->
|
|
|
|
>--+-+-ALIAS--<span class="italic">alias-name</span>----------------------------------+--IS--<span class="italic">string-constant</span>--+-><
|
|
| +-COLUMN--+-<span class="italic">table-name.column-name</span>-+--+------+-------+ |
|
|
| | '-<span class="italic">view-name.column-name</span>--' '-TEXT-' | |
|
|
| +-<span>INDEX</span>--<span><span class="italic">index-name</span></span>----------------------------------+ |
|
|
| +-PACKAGE--<span class="italic">package-name</span>--+-------------------------+-+ |
|
|
| | | .-VERSION-. | | |
|
|
| | '-+---------+--<span class="italic">version-id</span>-' | |
|
|
| +-SEQUENCE--<span class="italic">sequence-name</span>----------------------------+ |
|
|
| '-TABLE--+-<span class="italic">table-name</span>-+------------------------------' |
|
|
| '-<span class="italic">view-name</span>--' |
|
|
| .-,--------------------------------. |
|
|
| .-COLUMN-. V | |
|
|
+-+--------+--+-<span class="italic">table-name</span>-+--(----<span class="italic">column-name</span>--IS--<span class="italic">string-constant</span>-+--)-------+
|
|
| '-<span class="italic">view-name</span>--' |
|
|
| .-,--------------------------------------. |
|
|
| .-COLUMN-. V | |
|
|
'-+--------+--+-<span class="italic">table-name</span>-+--(----<span class="italic">column-name</span>--TEXT--IS--<span class="italic">string-constant</span>-+--)-'
|
|
'-<span class="italic">view-name</span>--'
|
|
|
|
</pre>
|
|
<a name="skipsyn-357" id="skipsyn-357"></a></div>
|
|
<a name="synslabel"></a>
|
|
<h3 id="synslabel"><a href="rbafzmst02.htm#ToC_1167">Description</a></h3>
|
|
<dl class="parml">
|
|
<dt class="bold">ALIAS </dt><a id="idx2888" name="idx2888"></a>
|
|
<dd>Specifies that the label is for an alias. Labels on aliases are implemented
|
|
as system object text.
|
|
<dl class="parml">
|
|
<dt class="bold"><var class="pv">alias-name</var> </dt><a id="idx2889" name="idx2889"></a>
|
|
<dd>Identifies the alias to which the label applies. The name must identify
|
|
an alias that exists at the current server.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt class="bold">COLUMN </dt><a id="idx2890" name="idx2890"></a>
|
|
<dd>Specifies that the label is for a column. Labels on columns are implemented
|
|
as system column headings or column text. Column headings are used when displaying
|
|
or printing query results.
|
|
<dl class="parml">
|
|
<dt class="bold"><var class="pv">table-name.column-name</var> <span class="base">or</span> <var class="pv">view-name.column-name</var> </dt><a id="idx2891" name="idx2891"></a>
|
|
<dd>Identifies the column to which the label applies. The <var class="pv">table-name</var> or <var class="pv">view-name</var> must identify a table or view that exists at the
|
|
current server, but must not identify a global temporary table. The <var class="pv">column-name</var> must identify a column of that table or view.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt class="bold"><a id="textis" name="textis"></a>TEXT </dt><a id="idx2892" name="idx2892"></a>
|
|
<dd>Specifies that i5/OS column text is specified. If TEXT is omitted,
|
|
a column heading is specified.
|
|
</dd>
|
|
<dt class="bold">INDEX</dt><a id="idx2893" name="idx2893"></a>
|
|
<dd>Specifies that the label is for an index. Labels on indexes are implemented
|
|
as system object text.
|
|
<dl class="parml">
|
|
<dt class="bold"><var class="pv">index-name</var> </dt><a id="idx2894" name="idx2894"></a>
|
|
<dd>Identifies the index to which the label applies. The name must identify
|
|
an index that exists at the current server.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt class="bold">PACKAGE </dt><a id="idx2895" name="idx2895"></a>
|
|
<dd>Specifies that the label is for a package. Labels on packages are implemented
|
|
as system object text.
|
|
<dl class="parml">
|
|
<dt class="bold"><var class="pv">package-name</var> </dt><a id="idx2896" name="idx2896"></a>
|
|
<dd>Identifies the package to which the label applies. The name must identify
|
|
a package that exists at the current server.
|
|
</dd>
|
|
<dt class="bold">VERSION <var class="pv">version-id</var></dt>
|
|
<dd><var class="pv">version-id</var> is the version identifier that was assigned to the
|
|
package when it was created. If <var class="pv">version-id</var> is not specified, a null
|
|
string is used as the version identifier.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt class="bold">SEQUENCE</dt><a id="idx2897" name="idx2897"></a>
|
|
<dd>Specifies that the label is for a sequence. Labels on sequences are
|
|
implemented as system object text.
|
|
<dl class="parml">
|
|
<dt class="bold"><var class="pv">sequence-name</var></dt><a id="idx2898" name="idx2898"></a>
|
|
<dd>Identifies the sequence on which you want to add a label. The <var class="pv">sequence-name</var> must identify a sequence that exists at the current server.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt class="bold">TABLE </dt><a id="idx2899" name="idx2899"></a>
|
|
<dd>Specifies that the label is for a table or a view. Labels on tables
|
|
or views are implemented as system object text.
|
|
<dl class="parml">
|
|
<dt class="bold"><var class="pv">table-name</var> <span class="base">or</span> <var class="pv">view-name</var> </dt><a id="idx2900" name="idx2900"></a><a id="idx2901" name="idx2901"></a>
|
|
<dd>Identifies the table or view on which you want to add a label. The <var class="pv">table-name</var> or <var class="pv">view-name</var> must identify a table or view that exists
|
|
at the current server, but must not identify a global temporary table.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt class="bold">IS </dt><a id="idx2902" name="idx2902"></a>
|
|
<dd>Introduces the label you want to provide.
|
|
<dl class="parml">
|
|
<dt class="bold"><var class="pv">string-constant</var> </dt><a id="idx2903" name="idx2903"></a>
|
|
<dd>Can be any SQL character-string
|
|
constant of up to either 50 bytes in length for tables, views, aliases, SQL
|
|
packages, sequences, or column text, or 60 bytes in length for column headings.
|
|
The constant may contain single-byte and double-byte characters.
|
|
<p>The label
|
|
for a column heading consists of three 20-byte segments. Interactive SQL,
|
|
the Query/400 program, IBM DB2 Query Manager and SQL Development Kit for iSeries, 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.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
<a name="wq1635"></a>
|
|
<h3 id="wq1635"><a href="rbafzmst02.htm#ToC_1168">Notes</a></h3>
|
|
<p><span class="bold">Column headings:</span> 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.</p>
|
|
<p>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.</p>
|
|
<p>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).</p>
|
|
<p><span class="bold">Syntax alternatives:</span> The following keywords are synonyms
|
|
supported for compatibility to prior releases. These keywords are non-standard
|
|
and should not be used:</p>
|
|
<ul>
|
|
<li>The keyword PROGRAM can be used as a synonym for PACKAGE.</li></ul>
|
|
<a name="wq1636"></a>
|
|
<h3 id="wq1636"><a href="rbafzmst02.htm#ToC_1169">Examples</a></h3>
|
|
<p><span class="italic">Example 1:</span> Enter a label on the DEPTNO column of
|
|
table DEPARTMENT. </p>
|
|
<a name="reflab3"></a>
|
|
<pre id="reflab3" class="xmp"> <span class="bold">LABEL ON COLUMN</span> DEPARTMENT.DEPTNO
|
|
<span class="bold">IS</span> 'DEPARTMENT NUMBER'</pre>
|
|
<p><span class="italic">Example 2:</span> Enter a label on the DEPTNO column of
|
|
table DEPARTMENT where the column heading is shown on two separate lines. </p>
|
|
<pre class="xmp"> <span class="bold">LABEL ON COLUMN</span> DEPARTMENT.DEPTNO
|
|
<span class="bold">IS</span> 'Department Number'</pre>
|
|
<p><span class="italic">Example 3:</span> Enter a label on the PAYROLL package. </p>
|
|
<a name="reflab4"></a>
|
|
<pre id="reflab4" class="xmp"> <span class="bold">LABEL ON PACKAGE</span> PAYROLL
|
|
<span class="bold">IS</span> 'Payroll Package'</pre><a id="idx2904" name="idx2904"></a><a id="idx2905" name="idx2905"></a>
|
|
<hr /><br />
|
|
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstbackup.htm">Previous Page</a> | <a href="rbafzmsth2lockt.htm">Next Page</a> | <a href="rbafzmst02.htm#wq1">Contents</a> |
|
|
<a href="rbafzmstindex.htm#index">Index</a> ]
|
|
|
|
<a id="Bot_Of_Page" name="Bot_Of_Page"></a>
|
|
</body>
|
|
</html>
|