ibm-information-center/dist/eclipse/plugins/i5OS.ic.sqlp_5.4.0.1/rbafycreatinglabelon.htm

99 lines
6.2 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 lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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="DC.Type" content="reference" />
<meta name="DC.Title" content="Create descriptive labels using the LABEL ON statement" />
<meta name="abstract" content="Sometimes the table name, column name, view name, index name, sequence name, alias name, or SQL package name does not clearly define data that is shown on an interactive display of the table. You can create a more descriptive label for these names by using the LABEL ON statement." />
<meta name="description" content="Sometimes the table name, column name, view name, index name, sequence name, alias name, or SQL package name does not clearly define data that is shown on an interactive display of the table. You can create a more descriptive label for these names by using the LABEL ON statement." />
<meta name="DC.subject" content="LABEL ON statement, statements, LABEL ON statement, example, table, defining name, column, defining heading, catalog, LABEL ON information, information in catalog, examples" />
<meta name="keywords" content="LABEL ON statement, statements, LABEL ON statement, example, table, defining name, column, defining heading, catalog, LABEL ON information, information in catalog, examples" />
<meta name="DC.Relation" scheme="URI" content="rbafysqltech.htm" />
<meta name="DC.Relation" scheme="URI" content="../db2/rbafzmstlabelon.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbafycreatinglabelon" />
<meta name="DC.Language" 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. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Create descriptive labels using the LABEL ON statement</title>
</head>
<body id="rbafycreatinglabelon"><a name="rbafycreatinglabelon"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Create descriptive labels using the LABEL ON statement</h1>
<div><p><span>Sometimes the table name, column name, view
name, index name, sequence name, alias name, or SQL package name does not
clearly define data that is shown on an interactive display of the table.
You can create a more descriptive label for these names by using the LABEL
ON statement.</span></p>
<div class="section"><p>These labels can be seen in the SQL catalog in the LABEL column.</p>
</div>
<div class="section"><p>The LABEL ON statement looks like this: </p>
<pre> <strong>LABEL ON
TABLE</strong> CORPDATA.DEPARTMENT <strong>IS</strong> 'Department Structure Table'
<strong>LABEL ON
COLUMN</strong> CORPDATA.DEPARTMENT.ADMRDEPT <strong>IS</strong> 'Reports to Dept.'</pre>
</div>
<div class="section"><p>After these statements are run, the table named DEPARTMENT displays
the text description as <em>Department Structure Table</em> and the column named <em>ADMRDEPT</em> displays
the heading <em>Reports to Dept.</em> The label for tables, views, indexes,
sequence, SQL packages, and column text cannot be more than 50 characters
and the label for column headings cannot be more than 60 characters (blanks
included). The following are examples of LABEL ON statements for column headings:</p>
</div>
<div class="section"><p>This LABEL ON statement provides column heading 1 and column heading
2. </p>
<pre> *...+....1....+....2....+....3....+....4....+....5....+....6..*
<strong>LABEL ON COLUMN</strong> CORPDATA.EMPLOYEE.EMPNO <strong>IS</strong>
'Employee Number'
</pre>
</div>
<div class="section"><p>This LABEL ON statement provides 3 levels of column headings for
the SALARY column. </p>
<pre> *...+....1....+....2....+....3....+....4....+....5....+....6..*
<strong>LABEL ON COLUMN</strong> CORPDATA.EMPLOYEE.SALARY <strong>IS</strong>
'Yearly Salary (in dollars)'
</pre>
</div>
<div class="section"><p>This LABEL ON statement removes the column heading for SALARY.
</p>
<pre> *...+....1....+....2....+....3....+....4....+....5....+....6..*
<strong>LABEL ON COLUMN</strong> CORPDATA.EMPLOYEE.SALARY <strong>IS</strong> ''
</pre>
</div>
<div class="section"><p>An example of a DBCS column heading with two levels specified.
</p>
<pre> *...+....1....+....2....+....3....+....4....+....5....+....6..*
<strong>LABEL ON COLUMN</strong> CORPDATA.EMPLOYEE.SALARY <strong>IS</strong>
'&lt;AABBCCDD&gt; &lt;EEFFGG&gt;'
</pre>
</div>
<div class="section"><p>This LABEL ON statement provides column text for the EDLEVEL column.
</p>
<pre> *...+....1....+....2....+....3....+....4....+....5....+....6..*
<strong>LABEL ON COLUMN</strong> CORPDATA.EMPLOYEE.EDLEVEL <strong>TEXT IS</strong>
'Number of years of formal education'
</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafysqltech.htm" title="Data definition language (DDL) describes the portion of SQL that allows you to create, alter, and destroy database objects. These database objects include schemas, tables, views, sequences, catalogs, indexes, and aliases.">Data definition language (DDL)</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../db2/rbafzmstlabelon.htm">LABEL ON</a></div>
</div>
</div>
</body>
</html>