270 lines
15 KiB
HTML
270 lines
15 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))' />
|
|
<title>How to use this book</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="howtouse"></a>
|
|
<h2 id="howtouse"><a href="rbafzmst02.htm#ToC_5">How to use this book</a></h2>
|
|
<p>This book defines the DB2® UDB SQL language elements for DB2 UDB for iSeries.</p>
|
|
<a name="sqlrassume"></a>
|
|
<h3 id="sqlrassume"><a href="rbafzmst02.htm#ToC_6">Assumptions relating to examples of SQL statements</a></h3>
|
|
<p>The examples of SQL statements shown in this guide assume the following:</p>
|
|
<ul>
|
|
<li>SQL keywords are highlighted.</li>
|
|
<li>Table names used in the examples are the sample tables provided in Appendix
|
|
A of the <a href="../sqlp/rbafykickoff.htm">SQL Programming</a> book. Table names that are
|
|
not provided in that appendix should use schemas that you create. You can
|
|
create a set of sample tables in your own schema by issuing the following
|
|
SQL statement:
|
|
<pre class="xmp"><span class="bold">CALL</span> QSYS.CREATE_SQL_SAMPLE ('your-schema-name')</pre></li>
|
|
<li>The SQL naming convention is used.</li>
|
|
<li>For COBOL examples, the APOST and APOSTSQL precompiler options are assumed
|
|
(although they are not the default in COBOL). Character-string constants within
|
|
SQL and host language statements are delimited by apostrophes (').</li>
|
|
<li>A sort sequence of *HEX is used.</li></ul><p class="indatacontent">Whenever the examples vary from these assumptions, it is stated.</p>
|
|
<p>See also <a href="rbafzmsthowtous.htm#sqlrcodedis">Code disclaimer information</a>.</p>
|
|
<a name="sqlrcodedis"></a>
|
|
<h4 id="sqlrcodedis">Code disclaimer information</h4>
|
|
<p>This document contains programming examples.</p>
|
|
<p>IBM® grants you a nonexclusive copyright license to use all programming
|
|
code examples from which you can generate similar function tailored to your
|
|
own specific needs.</p>
|
|
<p>All sample code is provided by IBM for illustrative purposes only. These
|
|
examples have not been thoroughly tested under all conditions. IBM, therefore,
|
|
cannot guarantee or imply reliability, serviceability, or function of these
|
|
programs.</p>
|
|
<p>All programs contained herein are provided to you "AS IS" without any warranties
|
|
of any kind. The implied warranties of non-infringement, merchantability and
|
|
fitness for a particular purpose are expressly disclaimed.</p>
|
|
<a name="sqlrsyntax"></a>
|
|
<h3 id="sqlrsyntax"><a href="rbafzmst02.htm#ToC_8">How to read the syntax diagrams</a></h3>
|
|
<p>The following rules apply to the syntax diagrams used in this book: </p>
|
|
<ul>
|
|
<li>Read the syntax diagrams from left to right, from top to bottom, following
|
|
the path of the line.
|
|
<p>The >>--- symbol indicates
|
|
the beginning of a statement.</p>
|
|
<p>The ---> symbol indicates
|
|
that the statement syntax is continued on the next line.</p>
|
|
<p>The >---
|
|
symbol indicates that a statement is continued from the previous line.</p>
|
|
<p>The --->< symbol indicates the end of a statement.</p>
|
|
<p>Diagrams of syntactical units other than complete statements start
|
|
with the |--- symbol and end with the ---| symbol.</p></li>
|
|
<li>Required items appear on the horizontal line (the main path).
|
|
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn2.htm"
|
|
border="0" /></span><a href="#skipsyn-1"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a>>>-<span class="italic">required_item</span>-----------------------------------------------><
|
|
|
|
</pre>
|
|
<a name="skipsyn-1" id="skipsyn-1"></a></li>
|
|
<li>Optional items appear below the main path.
|
|
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn3.htm"
|
|
border="0" /></span><a href="#skipsyn-2"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a>>>-<span class="italic">required_item</span>--+---------------+----------------------------><
|
|
'-<span class="italic">optional_item</span>-'
|
|
|
|
</pre>
|
|
<a name="skipsyn-2" id="skipsyn-2"></a>
|
|
|
|
<p>If an item appears above the main path, that item is optional,
|
|
and has no effect on the execution of the statement and is used only for readability.
|
|
</p>
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn4.htm"
|
|
border="0" /></span><a href="#skipsyn-3"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a> .-<span class="italic">optional_item</span>-.
|
|
>>-<span class="italic">required_item</span>--+---------------+----------------------------><
|
|
|
|
</pre>
|
|
<a name="skipsyn-3" id="skipsyn-3"></a></li>
|
|
<li>If more than one item can be chosen, they appear vertically, in a stack.
|
|
<p>If one of the items must be chosen, one item of the stack appears on the main
|
|
path.
|
|
</p>
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn5.htm"
|
|
border="0" /></span><a href="#skipsyn-4"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a>>>-<span class="italic">required_item</span>--+-<span class="italic">required_choice</span>-+--------------------------><
|
|
'-<span class="italic">required_choice</span>-'
|
|
|
|
</pre>
|
|
<a name="skipsyn-4" id="skipsyn-4"></a>
|
|
<p>If choosing one of the items is optional, the entire stack
|
|
appears below the main path.
|
|
</p>
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn6.htm"
|
|
border="0" /></span><a href="#skipsyn-5"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a>>>-<span class="italic">required_item</span>--+-----------------+--------------------------><
|
|
+-<span class="italic">optional_choice</span>-+
|
|
'-<span class="italic">optional_choice</span>-'
|
|
|
|
</pre>
|
|
<a name="skipsyn-5" id="skipsyn-5"></a>
|
|
<p>If one of the items is the default, it will appear above
|
|
the main path and the remaining choices will be shown below.
|
|
</p>
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn7.htm"
|
|
border="0" /></span><a href="#skipsyn-6"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a> .-<span class="italic">default_choice</span>--.
|
|
>>-<span class="italic">required_item</span>--+-----------------+--------------------------><
|
|
+-<span class="italic">optional_choice</span>-+
|
|
'-<span class="italic">optional_choice</span>-'
|
|
|
|
</pre>
|
|
<a name="skipsyn-6" id="skipsyn-6"></a>
|
|
<p>If an optional item has a default when it is not
|
|
specified, the default appears above the main path.
|
|
</p>
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn8.htm"
|
|
border="0" /></span><a href="#skipsyn-7"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a>>>-<span class="italic">required_item</span>--+--------------------------------------+-----><
|
|
| .-<span class="italic">default_choice</span>--. |
|
|
+-<span class="italic">optional_choice</span>--+-<span class="italic">required_choice</span>-+-+
|
|
| '-<span class="italic">required_choice</span>-' |
|
|
'-<span class="italic">optional_choice</span>----------------------'
|
|
|
|
</pre>
|
|
<a name="skipsyn-7" id="skipsyn-7"></a></li>
|
|
<li>An arrow returning to the left, above the main line, indicates an item
|
|
that can be repeated.
|
|
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn9.htm"
|
|
border="0" /></span><a href="#skipsyn-8"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a> .-----------------.
|
|
V |
|
|
>>-<span class="italic">required_item</span>----<span class="italic">repeatable_item</span>-+--------------------------><
|
|
|
|
</pre>
|
|
<a name="skipsyn-8" id="skipsyn-8"></a>
|
|
|
|
<p>If the repeat arrow contains a comma, you must separate repeated
|
|
items with a comma.
|
|
</p>
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn10.htm"
|
|
border="0" /></span><a href="#skipsyn-9"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a> .-,---------------.
|
|
V |
|
|
>>-<span class="italic">required_item</span>----<span class="italic">repeatable_item</span>-+--------------------------><
|
|
|
|
</pre>
|
|
<a name="skipsyn-9" id="skipsyn-9"></a>
|
|
<p>A repeat arrow above a stack indicates that you can repeat
|
|
the items in the stack.</p></li>
|
|
<li>Keywords appear in uppercase (for example, <tt class="xph">FROM</tt>). They must
|
|
be spelled exactly as shown. Variables appear in all lowercase letters (for
|
|
example, <var class="pv">column-name</var>). They represent user-supplied names or values.</li>
|
|
<li>If punctuation marks, parentheses, arithmetic operators, or other such
|
|
symbols are shown, you must enter them as part of the syntax.</li>
|
|
<li>The syntax diagrams only contain the preferred or standard keywords. If
|
|
non-standard synonyms are supported in addition to the standard keywords,
|
|
they are described the <span class="bold">Notes</span> sections instead of the
|
|
syntax diagrams. For maximum portability, only the preferred or standard keywords
|
|
should be used.</li>
|
|
<li>Sometimes a single variable represents a larger fragment of the syntax.
|
|
For example, in the following diagram, the variable <tt class="xph">parameter-block</tt> represents
|
|
the whole syntax fragment that is labeled <span class="bold">parameter-block</span>:
|
|
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn11.htm"
|
|
border="0" /></span><a href="#skipsyn-10"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a>>>-<span class="italic">required_item</span>--| parameter-block |--------------------------><
|
|
|
|
parameter-block:
|
|
|
|
|--+-<span class="italic">parameter1</span>-----------------+-------------------------------|
|
|
'-<span class="italic">parameter2</span>--+-<span class="italic">parameter3</span>-+-'
|
|
'-<span class="italic">parameter4</span>-'
|
|
|
|
</pre>
|
|
<a name="skipsyn-10" id="skipsyn-10"></a></li></ul>
|
|
<a name="wq2"></a>
|
|
<h3 id="wq2"><a href="rbafzmst02.htm#ToC_9">Conventions used in this book</a></h3>
|
|
<p>This section specifies some conventions which are used throughout this
|
|
manual.</p>
|
|
<a name="wq3"></a>
|
|
<h4 id="wq3">Highlighting conventions</h4>
|
|
<p>The following conventions are used in this book.</p>
|
|
<a name="wq4"></a>
|
|
<table id="wq4" width="100%" summary="" border="1" frame="hsides" rules="rows">
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td width="16%"><span class="bold">Bold</span></td>
|
|
<td width="83%">Indicates SQL keywords used in examples and when introducing descriptions
|
|
involving the keyword.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="italic">Italics</span></td>
|
|
<td>Indicates one of the following:
|
|
<ul>
|
|
<li>Variables that represent items from a syntax diagram.</li>
|
|
<li>The introduction of a new term.</li>
|
|
<li>A reference to another source of information.</li></ul></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="sqlrmixedata"></a>
|
|
<h4 id="sqlrmixedata">Conventions for describing mixed data values</h4>
|
|
<p>When mixed data values are shown in the examples, the following conventions
|
|
apply:</p>
|
|
<div class="mmobj">
|
|
<img src="rv2w926.gif" alt="Conventions for describing mixed data values. Shift-out character represented by X' 0E', shift-in characters represented by X' 0F', single-byte characters represented by sbcs-string, double-byte characters represented by dbcs-string, DBCS apostrophe represented by EBCDIC X' 427D, and DBCS G represented by EBCDIC X' 42C7." /></div>
|
|
<a name="accessibility"></a>
|
|
<h3 id="accessibility"><a href="rbafzmst02.htm#ToC_12">SQL accessibility</a></h3>
|
|
<p>IBM is committed to providing interfaces and documentation that are easily
|
|
accessible to the disabled community. For general information on IBM's Accessibility
|
|
support visit the <a href="http://www.ibm.com/able">Accessibility Center</a> at
|
|
http://www.ibm.com/able.
|
|
<img src="www.gif" alt="Link outside of Information Center" /></p>
|
|
<p>SQL accessibility support falls in two main categories.</p>
|
|
<ul>
|
|
<li>iSeries™ Navigator is graphical user interface to iSeries and DB2 UDB. For information
|
|
about the Accessibility features supported in Windows® graphical user interfaces, see
|
|
Accessibility in the Windows Help Index.</li>
|
|
<li>Online documentation, online help, and prompted SQL interfaces can be
|
|
accessed by a Windows Reader program such as the IBM Home Page Reader.
|
|
For information on the IBM Home Page Reader and other tools, visit the <a href="http://www.ibm.com/able">Accessibility Center</a>
|
|
<img src="www.gif" alt="Link outside of Information Center" />.</li></ul>
|
|
<p>The IBM Home Page Reader can be used to access all descriptive text in this
|
|
book, all articles in the SQL Information Center, and all SQL messages. Due
|
|
to the complex nature of SQL syntax diagrams, however, the reader will skip
|
|
syntax diagrams. Two alternatives are provided for better ease of use:</p>
|
|
<ul>
|
|
<li>Interactive SQL and Query Manager
|
|
<p>Interactive SQL and Query Manager
|
|
are traditional file interfaces that provide prompting for SQL statements.
|
|
These are part of the DB2 UDB Query Manager and SQL Development Kit. For more
|
|
information about Interactive SQL and Query Manager, see the <a href="../sqlp/rbafykickoff.htm">SQL Programming</a> and <a href="../books/sc415212.pdf">Query Manager Use</a>
|
|
<img src="wbpdf.gif" alt="Link to PDF" />books.</p></li>
|
|
<li>SQL Assist
|
|
<p>SQL Assist is a graphical user interface that provides a
|
|
prompted interface to SQL statements. This is part of iSeries Navigator.
|
|
For more information, see the iSeries Navigator online help and the Information
|
|
Center.</p></li></ul>
|
|
<hr /><br />
|
|
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstsqlrwho.htm">Previous Page</a> | <a href="rbafzmstprintthis.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>
|