72 lines
4.9 KiB
HTML
72 lines
4.9 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="Describe an SQL object using COMMENT ON" />
|
||
|
<meta name="abstract" content="After you create an SQL object such as a table, view, index, package, procedure, parameter, user-defined type, function, trigger, or sequence, you can supply information about it for future reference. You can add information by using the COMMENT ON statement." />
|
||
|
<meta name="description" content="After you create an SQL object such as a table, view, index, package, procedure, parameter, user-defined type, function, trigger, or sequence, you can supply information about it for future reference. You can add information by using the COMMENT ON statement." />
|
||
|
<meta name="DC.subject" content="COMMENT ON statement, using, example, statements, examples, getting comment" />
|
||
|
<meta name="keywords" content="COMMENT ON statement, using, example, statements, examples, getting comment" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafysqltech.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../db2/rbafzmstcomnt.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="rbafydescribingcommenton" />
|
||
|
<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>Describe an SQL object using COMMENT ON</title>
|
||
|
</head>
|
||
|
<body id="rbafydescribingcommenton"><a name="rbafydescribingcommenton"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Describe an SQL object using COMMENT ON</h1>
|
||
|
<div><p><span>After you create an SQL object such as a table,
|
||
|
view, index, package, procedure, parameter, user-defined type, function, trigger,
|
||
|
or sequence, you can supply information about it for future reference. You
|
||
|
can add information by using the COMMENT ON statement.</span></p>
|
||
|
<div class="section"><p>The information can be the purpose of the object,
|
||
|
who uses it, and anything unusual or special about it. You can also include
|
||
|
similar information about each column of a table or view. A comment is especially
|
||
|
useful if your names do not clearly indicate the contents of the columns or
|
||
|
objects. In that case, use a comment to describe the specific contents of
|
||
|
the column or objects. Usually, your comment must not be more than 2000 characters,
|
||
|
but for sequences the maximum length is 500 characters.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>An example of using COMMENT ON follows: </p>
|
||
|
<pre> <strong>COMMENT ON TABLE</strong> CORPDATA.EMPLOYEE <strong>IS</strong>
|
||
|
'Employee table. Each row in this table represents
|
||
|
one employee of the company.'</pre>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Get comments after running a COMMENT ON statement</h4><p>After
|
||
|
running a COMMENT ON statement for a table, your comments are stored in the <em>LONG_COMMENT</em> column
|
||
|
of SYSTABLES. Comments for the other objects are stored in the LONG_COMMENT
|
||
|
column of the appropriate catalog table. If the indicated row had already
|
||
|
contained a comment, the old comment is replaced by the new one. The
|
||
|
following example gets the comments added by the COMMENT ON statement in the
|
||
|
previous example: </p>
|
||
|
<pre> <strong>SELECT</strong> LONG_COMMENT
|
||
|
<strong>FROM</strong> CORPDATA.SYSTABLES
|
||
|
<strong>WHERE</strong> NAME = 'EMPLOYEE'</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/rbafzmstcomnt.htm">COMMENT ON</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|