741 lines
37 KiB
HTML
741 lines
37 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>Statements</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="states"></a>
|
|
<h1 id="states"><a href="rbafzmst02.htm#ToC_721">Statements</a></h1>
|
|
<a name="summsl"></a>
|
|
<p id="summsl">This chapter contains syntax diagrams, semantic descriptions,
|
|
rules, and examples of the use of the SQL statements listed in the following
|
|
table.</p>
|
|
<a name="schemastmt"></a>
|
|
<table id="schemastmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 36. SQL Schema Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq993" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq994" width="54%" align="left">Description</th>
|
|
<th id="wq995" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">ALTER PROCEDURE (External)</td>
|
|
<td align="left" valign="top" headers="wq994">Alters the description of an external procedure</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstaproceduree.htm#aproceduree">ALTER PROCEDURE (External)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">ALTER PROCEDURE (SQL)</td>
|
|
<td align="left" valign="top" headers="wq994">Alters the description of an SQL procedure</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstaprocedures.htm#aprocedures">ALTER PROCEDURE (SQL)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">ALTER SEQUENCE</td>
|
|
<td align="left" valign="top" headers="wq994">Alters the description of a sequence</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstasequence.htm#asequence">ALTER SEQUENCE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">ALTER TABLE</td>
|
|
<td align="left" valign="top" headers="wq994">Alters the description of a table</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstatabl.htm#atabl">ALTER TABLE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">COMMENT</td>
|
|
<td align="left" valign="top" headers="wq994">Replaces or adds a comment to the description
|
|
of an alias, column, function, index, package, parameter, procedure, table,
|
|
type or view</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcomnt.htm#xcomnt">COMMENT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE ALIAS</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an alias</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmsthcalias.htm#hcalias">CREATE ALIAS</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE DISTINCT TYPE</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a distinct type</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcrtudt.htm#crtudt">CREATE DISTINCT TYPE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE FUNCTION</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a user-defined function</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcreatef.htm#createf">CREATE FUNCTION</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE FUNCTION (External Scalar)</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an external scalar function</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcfsce.htm#cfsce">CREATE FUNCTION (External Scalar)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE FUNCTION (External Table)</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an external table function</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcftbe.htm#cftbe">CREATE FUNCTION (External Table)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE FUNCTION (Sourced)</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a user-defined function based on
|
|
another existing scalar or column function</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcfso.htm#cfso">CREATE FUNCTION (Sourced)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE FUNCTION (SQL Scalar)</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an SQL scalar function</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcfsc.htm#cfsc">CREATE FUNCTION (SQL Scalar)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE FUNCTION (SQL Table)</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an SQL table function</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcftb.htm#cftb">CREATE FUNCTION (SQL Table)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE INDEX</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an index on a table</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstxcindx.htm#xcindx">CREATE INDEX</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE PROCEDURE</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a procedure.</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcreatep.htm#createp">CREATE PROCEDURE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE PROCEDURE (External)</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an external procedure.</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcrtpef.htm#crtpef">CREATE PROCEDURE (External)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE PROCEDURE (SQL)</td>
|
|
<td align="left" valign="top" headers="wq994">Creates an SQL procedure.</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcrtpsf.htm#crtpsf">CREATE PROCEDURE (SQL)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE SCHEMA</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a schema and a set of objects in
|
|
that schema</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstxcschema.htm#xcschema">CREATE SCHEMA</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE SEQUENCE</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a sequence</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstcsequence.htm#csequence">CREATE SEQUENCE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE TABLE</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a table</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmsthctabl.htm#hctabl">CREATE TABLE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE TRIGGER</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a trigger</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmsthctrigger.htm#hctrigger">CREATE TRIGGER</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">CREATE VIEW</td>
|
|
<td align="left" valign="top" headers="wq994">Creates a view of one or more tables or views</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmsthcview.htm#hcview">CREATE VIEW</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">DROP</td>
|
|
<td align="left" valign="top" headers="wq994">Drops an alias, function, index, package,
|
|
procedure, schema, table, trigger, type, or view</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstdropst.htm#dropst">DROP</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">GRANT (Distinct Type Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Grants privileges on a distinct type</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstgntudtp.htm#gntudtp">GRANT (Distinct Type Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">GRANT (Function or Procedure Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Grants privileges on a function or procedure</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstgntprc.htm#gntprc">GRANT (Function or Procedure Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">GRANT (Package Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Grants privileges on a package</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstgntpp.htm#gntpp">GRANT (Package Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">GRANT (Sequence Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Grants privileges on a sequence</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstgntseqp.htm#gntseqp">GRANT (Sequence Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">GRANT (Table Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Grants privileges on a table or view</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstgnt.htm#gnt">GRANT (Table or View Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">LABEL</td>
|
|
<td align="left" valign="top" headers="wq994">Replaces or adds a label on the description
|
|
of an alias, column, package, table, or view</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstlabelon.htm#labelon">LABEL</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">RENAME</td>
|
|
<td align="left" valign="top" headers="wq994">Renames a table, view, or index.</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstrena.htm#rena">RENAME</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">REVOKE (Distinct Type Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Revokes the privilege to use a distinct type</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstrudtp.htm#rudtp">REVOKE (Distinct Type Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">REVOKE (Function or Procedure Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Revokes privileges on a function or procedure</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstrppro.htm#rppro">REVOKE (Function or Procedure Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">REVOKE (Package Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Revokes the privilege to execute statements
|
|
in a package</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstrppriv.htm#rppriv">REVOKE (Package Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">REVOKE (Sequence Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Revokes privileges on a sequence</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstrspriv.htm#rspriv">REVOKE (Sequence Privileges)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq993">REVOKE (Table Privileges)</td>
|
|
<td align="left" valign="top" headers="wq994">Revokes privileges on a table or view</td>
|
|
<td align="left" valign="top" headers="wq995"><a href="rbafzmstrevoket.htm#revoket">REVOKE (Table or View Privileges)</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="datachgstmt"></a>
|
|
<table id="datachgstmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 37. SQL Data Change Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq996" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq997" width="54%" align="left">Description</th>
|
|
<th id="wq998" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq996">DELETE</td>
|
|
<td align="left" valign="top" headers="wq997">Deletes one or more rows from a table</td>
|
|
<td align="left" valign="top" headers="wq998"><a href="rbafzmstdelst.htm#delst">DELETE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq996">INSERT</td>
|
|
<td align="left" valign="top" headers="wq997">Inserts one or more rows into a table</td>
|
|
<td align="left" valign="top" headers="wq998"><a href="rbafzmstbackup.htm#backup">INSERT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq996">UPDATE</td>
|
|
<td align="left" valign="top" headers="wq997">Updates the values of one or more columns
|
|
in one or more rows of a table</td>
|
|
<td align="left" valign="top" headers="wq998"><a href="rbafzmstupdt.htm#updt">UPDATE</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="datastmt"></a>
|
|
<table id="datastmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 38. SQL Data Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq999" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq1000" width="54%" align="left">Description</th>
|
|
<th id="wq1001" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999"></td>
|
|
<td align="left" valign="top" headers="wq1000">All SQL Data Change statements</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmststates.htm#datachgstmt">Table 37</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">CLOSE</td>
|
|
<td align="left" valign="top" headers="wq1000">Closes a cursor</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstclosst.htm#closst">CLOSE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">DECLARE CURSOR</td>
|
|
<td align="left" valign="top" headers="wq1000">Defines an SQL cursor</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmsth2clcu.htm#h2dclcu">DECLARE CURSOR</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">FETCH</td>
|
|
<td align="left" valign="top" headers="wq1000">Positions a cursor on a row of the result
|
|
table; can also assign values from one or more rows of the result table to
|
|
variables</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstfets.htm#fets">FETCH</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">FREE LOCATOR</td>
|
|
<td align="left" valign="top" headers="wq1000">Removes the association between a LOB locator
|
|
variable and its value</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstfreeloc.htm#freeloc">FREE LOCATOR</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">HOLD LOCATOR</td>
|
|
<td align="left" valign="top" headers="wq1000">Allows a LOB locator variable to retain its
|
|
association with a value beyond a unit of work</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstholdloc.htm#holdloc">HOLD LOCATOR</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">LOCK TABLE</td>
|
|
<td align="left" valign="top" headers="wq1000">Either prevents concurrent processes from
|
|
changing a table or prevents concurrent processes from using a table</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmsth2lockt.htm#h2lockt">LOCK TABLE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">OPEN</td>
|
|
<td align="left" valign="top" headers="wq1000">Opens a cursor</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmsthopen.htm#hopen">OPEN</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">REFRESH TABLE</td>
|
|
<td align="left" valign="top" headers="wq1000">Refreshes the data in a materialized query
|
|
table</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmsthrefresh.htm#hrefresh">REFRESH TABLE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">SELECT</td>
|
|
<td align="left" valign="top" headers="wq1000">Executes a query</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmsthselectstmt.htm#hselectstmt">SELECT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">SELECT INTO</td>
|
|
<td align="left" valign="top" headers="wq1000">Assigns values to variables</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmsthselin.htm#hselin">SELECT INTO</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">SET transition-variable</td>
|
|
<td align="left" valign="top" headers="wq1000">Assigns values to a transition variable</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstsettranv.htm#settranv">SET transition-variable</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">SET variable</td>
|
|
<td align="left" valign="top" headers="wq1000">Assigns values to a variable</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstsetinto.htm#setinto">SET variable</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">VALUES</td>
|
|
<td align="left" valign="top" headers="wq1000">Provides a method to invoke a user-defined
|
|
function from a trigger.</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstvaluestmt.htm#valuestmt">VALUES</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq999">VALUES INTO</td>
|
|
<td align="left" valign="top" headers="wq1000">Specifies a result table of no more than
|
|
one row and assigns the values to variables.</td>
|
|
<td align="left" valign="top" headers="wq1001"><a href="rbafzmstvalinto.htm#valinto">VALUES INTO</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="transstmt"></a>
|
|
<table id="transstmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 39. SQL Transaction Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1002" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq1003" width="54%" align="left">Description</th>
|
|
<th id="wq1004" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1002">COMMIT</td>
|
|
<td align="left" valign="top" headers="wq1003">Ends a unit of work and commits the database changes
|
|
made by that unit of work</td>
|
|
<td align="left" valign="top" headers="wq1004"><a href="rbafzmstc4comit.htm#c4comit">COMMIT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1002">RELEASE SAVEPOINT</td>
|
|
<td align="left" valign="top" headers="wq1003">Releases a savepoint within a unit of work</td>
|
|
<td align="left" valign="top" headers="wq1004"><a href="rbafzmstrlssvpt.htm#rlssvpt">RELEASE SAVEPOINT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1002">ROLLBACK</td>
|
|
<td align="left" valign="top" headers="wq1003">Ends a unit of work and backs out the database changes
|
|
made by that unit of work or made since the specified savepoint</td>
|
|
<td align="left" valign="top" headers="wq1004"><a href="rbafzmstrollbac.htm#rollbac">ROLLBACK</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1002">SAVEPOINT</td>
|
|
<td align="left" valign="top" headers="wq1003">Sets a savepoint within a unit of work</td>
|
|
<td align="left" valign="top" headers="wq1004"><a href="rbafzmstsvpt.htm#svpt">SAVEPOINT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1002">SET TRANSACTION</td>
|
|
<td align="left" valign="top" headers="wq1003">Changes the isolation level for the current
|
|
unit of work</td>
|
|
<td align="left" valign="top" headers="wq1004"><a href="rbafzmstsettraj.htm#settraj">SET TRANSACTION</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="connectstmt"></a>
|
|
<table id="connectstmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 40. SQL Connection Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1005" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq1006" width="54%" align="left">Description</th>
|
|
<th id="wq1007" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1005">CONNECT (Type 1)</td>
|
|
<td align="left" valign="top" headers="wq1006">Connects to an application server and establishes
|
|
the rules for remote unit of work</td>
|
|
<td align="left" valign="top" headers="wq1007"><a href="rbafzmstconj1.htm#conj1">CONNECT (Type 1)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1005">CONNECT (Type 2)</td>
|
|
<td align="left" valign="top" headers="wq1006">Connects to an application server and establishes
|
|
the rules for application-directed distributed unit of work</td>
|
|
<td align="left" valign="top" headers="wq1007"><a href="rbafzmstcon2t.htm#con2t">CONNECT (Type 2)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1005">DISCONNECT</td>
|
|
<td align="left" valign="top" headers="wq1006">Immediately ends one or more connections</td>
|
|
<td align="left" valign="top" headers="wq1007"><a href="rbafzmstdiscon.htm#discon">DISCONNECT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1005">RELEASE (Connection)</td>
|
|
<td align="left" valign="top" headers="wq1006">Places one or more connections in the release-pending state</td>
|
|
<td align="left" valign="top" headers="wq1007"><a href="rbafzmstrele.htm#rele">RELEASE (Connection)</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1005">SET CONNECTION</td>
|
|
<td align="left" valign="top" headers="wq1006">Establishes the application server of the process
|
|
by identifying one of its existing connections</td>
|
|
<td align="left" valign="top" headers="wq1007"><a href="rbafzmstetconj.htm#etconj">SET CONNECTION</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="dynstmt"></a>
|
|
<table id="dynstmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 41. SQL Dynamic Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1008" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq1009" width="54%" align="left">Description</th>
|
|
<th id="wq1010" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">ALLOCATE DESCRIPTOR</td>
|
|
<td align="left" valign="top" headers="wq1009">Allocates an SQL descriptor</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzallocatedescr.htm#allocatedescr">ALLOCATE DESCRIPTOR</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">DEALLOCATE DESCRIPTOR</td>
|
|
<td align="left" valign="top" headers="wq1009">Deallocates an SQL descriptor</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzdeallocatedescr.htm#deallocatedescr">DEALLOCATE DESCRIPTOR</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">DESCRIBE</td>
|
|
<td align="left" valign="top" headers="wq1009">Describes the result columns of a prepared
|
|
statement</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzmstdescr.htm#descr">DESCRIBE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">DESCRIBE INPUT</td>
|
|
<td align="left" valign="top" headers="wq1009">Describes the input parameter markers of
|
|
a prepared statement</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzdescrinput.htm#descrinput">DESCRIBE INPUT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">DESCRIBE TABLE</td>
|
|
<td align="left" valign="top" headers="wq1009">Describes the columns of a table
|
|
or view</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzmstdescrtb.htm#descrtb">DESCRIBE TABLE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">EXECUTE</td>
|
|
<td align="left" valign="top" headers="wq1009">Executes a prepared SQL statement</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzmsthexeqt.htm#hexeqt">EXECUTE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">EXECUTE IMMEDIATE</td>
|
|
<td align="left" valign="top" headers="wq1009">Prepares and executes an SQL statement</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzmstexim.htm#exim">EXECUTE IMMEDIATE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">GET DESCRIPTOR</td>
|
|
<td align="left" valign="top" headers="wq1009">Gets information from an SQL descriptor</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzgetdescr.htm#getdescr">GET DESCRIPTOR</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">PREPARE</td>
|
|
<td align="left" valign="top" headers="wq1009">Prepares an SQL statement for execution</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzmstpreph2.htm#preph2">PREPARE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1008">SET DESCRIPTOR</td>
|
|
<td align="left" valign="top" headers="wq1009">Sets items in an SQL descriptor</td>
|
|
<td align="left" valign="top" headers="wq1010"><a href="rbafzsetdescr.htm#setdescr">SET DESCRIPTOR</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="sessionstmt"></a>
|
|
<table id="sessionstmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 42. SQL Session Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1011" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq1012" width="54%" align="left">Description</th>
|
|
<th id="wq1013" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1011">DECLARE GLOBAL TEMPORARY TABLE</td>
|
|
<td align="left" valign="top" headers="wq1012">Defines a declared global temporary table</td>
|
|
<td align="left" valign="top" headers="wq1013"><a href="rbafzmstdgtt.htm#dgtt">DECLARE GLOBAL TEMPORARY TABLE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1011">SET CURRENT DEBUG MODE</td>
|
|
<td align="left" valign="top" headers="wq1012">Assigns a value to the CURRENT DEBUG MODE
|
|
special register</td>
|
|
<td align="left" valign="top" headers="wq1013"><a href="rbafzmstsetdebug.htm#setdebug">SET CURRENT DEBUG MODE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1011">SET CURRENT DEGREE</td>
|
|
<td align="left" valign="top" headers="wq1012">Assigns a value to the CURRENT DEGREE special
|
|
register</td>
|
|
<td align="left" valign="top" headers="wq1013"><a href="rbafzsetdegree.htm#setdegree">SET CURRENT DEGREE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1011">SET ENCRYPTION PASSWORD</td>
|
|
<td align="left" valign="top" headers="wq1012">Assigns a value to the default encryption
|
|
password and default encryption password hint</td>
|
|
<td align="left" valign="top" headers="wq1013"><a href="rbafzmstsetep.htm#setep">SET ENCRYPTION PASSWORD</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1011">SET PATH</td>
|
|
<td align="left" valign="top" headers="wq1012">Assigns a value to the CURRENT PATH special
|
|
register</td>
|
|
<td align="left" valign="top" headers="wq1013"><a href="rbafzmstsetpath.htm#setpath">SET PATH</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1011">SET SCHEMA</td>
|
|
<td align="left" valign="top" headers="wq1012">Assigns a value to the CURRENT SCHEMA special
|
|
register</td>
|
|
<td align="left" valign="top" headers="wq1013"><a href="rbafzmstsetschema.htm#setschema">SET SCHEMA</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1011">SET SESSION AUTHORIZATION</td>
|
|
<td align="left" valign="top" headers="wq1012">Changes the user of the job and the USER
|
|
special register</td>
|
|
<td align="left" valign="top" headers="wq1013"><a href="rbafzsetsessionauth.htm#setsessionauth">SET SESSION AUTHORIZATION</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="hoststmt"></a>
|
|
<table id="hoststmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 43. SQL Embedded Host Language Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1014" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq1015" width="54%" align="left">Description</th>
|
|
<th id="wq1016" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">BEGIN DECLARE SECTION</td>
|
|
<td align="left" valign="top" headers="wq1015">Marks the beginning of an SQL declare section</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstbegdcl.htm#begdcl">BEGIN DECLARE SECTION</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">DECLARE PROCEDURE</td>
|
|
<td align="left" valign="top" headers="wq1015">Defines an external procedure</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstdclpef.htm#dclpef">DECLARE PROCEDURE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">DECLARE STATEMENT</td>
|
|
<td align="left" valign="top" headers="wq1015">Declares the names used to identify prepared
|
|
SQL statements</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstdclst.htm#dclst">DECLARE STATEMENT</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">DECLARE VARIABLE</td>
|
|
<td align="left" valign="top" headers="wq1015">Declares a subtype or normalized other than
|
|
the default for a host variable</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstdeclvar.htm#declvar">DECLARE VARIABLE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">END DECLARE SECTION</td>
|
|
<td align="left" valign="top" headers="wq1015">Marks the end of an SQL declare section</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmsteds.htm#eds">END DECLARE SECTION</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">GET DIAGNOSTICS</td>
|
|
<td align="left" valign="top" headers="wq1015">Obtains information about the previously
|
|
executed SQL statement</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstgetdiag.htm#getdiag">GET DIAGNOSTICS</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">INCLUDE</td>
|
|
<td align="left" valign="top" headers="wq1015">Inserts declarations into a source program</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstclucu.htm#clucu">INCLUDE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">SET OPTION</td>
|
|
<td align="left" valign="top" headers="wq1015">Establishes the options for processing SQL
|
|
statements</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstsoption.htm#soption">SET OPTION</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">SET RESULT SET</td>
|
|
<td align="left" valign="top" headers="wq1015">Identifies the result sets in a procedure</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmsthsetrs.htm#hsetrs">SET RESULT SETS</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">SIGNAL</td>
|
|
<td align="left" valign="top" headers="wq1015">Signals an error or warning condition</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstsignal.htm#signal">SIGNAL</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1014">WHENEVER</td>
|
|
<td align="left" valign="top" headers="wq1015">Defines actions to be taken on the basis
|
|
of SQL return codes</td>
|
|
<td align="left" valign="top" headers="wq1016"><a href="rbafzmstwvrr.htm#wvrr">WHENEVER</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="ctlstmt"></a>
|
|
<table id="ctlstmt" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 44. SQL Control Statements</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1017" width="26%" align="left">SQL Statement</th>
|
|
<th id="wq1018" width="54%" align="left">Description</th>
|
|
<th id="wq1019" width="19%" align="left">Page</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">assignment-statement</td>
|
|
<td align="left" valign="top" headers="wq1018">Assigns a value to an output parameter or
|
|
to a local variable</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstassignstmt.htm#assignstmt">assignment-statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">CALL</td>
|
|
<td align="left" valign="top" headers="wq1018">Calls a procedure</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstcallsta.htm#callsta">CALL</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">CASE</td>
|
|
<td align="left" valign="top" headers="wq1018">Selects an execution path based on multiple
|
|
conditions</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstcasestmt.htm#casestmt">CASE statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">compound-statement</td>
|
|
<td align="left" valign="top" headers="wq1018">Groups other statements together in an SQL
|
|
routine</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstcompoundstmt.htm#compoundstmt">compound-statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">FOR</td>
|
|
<td align="left" valign="top" headers="wq1018">Executes a statement for each row of a table</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstforstmt.htm#forstmt">FOR statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">GET DIAGNOSTICS</td>
|
|
<td align="left" valign="top" headers="wq1018">Obtains information about the previously
|
|
executed SQL statement</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstgetdiag2.htm#getdiag2">GET DIAGNOSTICS statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">GOTO</td>
|
|
<td align="left" valign="top" headers="wq1018">Branches to a user-defined label within an
|
|
SQL routine or trigger</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstgotostmt.htm#gotostmt">GOTO statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">IF</td>
|
|
<td align="left" valign="top" headers="wq1018">Provides conditional execution based on the
|
|
truth value of a condition</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstifstmt.htm#ifstmt">IF statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">ITERATE</td>
|
|
<td align="left" valign="top" headers="wq1018">Causes the flow of control to return to the
|
|
beginning of a labelled loop</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstiteratestmt.htm#iteratestmt">ITERATE statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">LEAVE</td>
|
|
<td align="left" valign="top" headers="wq1018">Continues execution by leaving a block or
|
|
loop</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstleavestmt.htm#leavestmt">LEAVE statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">LOOP</td>
|
|
<td align="left" valign="top" headers="wq1018">Repeats the execution of a statement</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstloopstmt.htm#loopstmt">LOOP statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">REPEAT</td>
|
|
<td align="left" valign="top" headers="wq1018">Repeats the execution of a statement</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstrepeatstmt.htm#repeatstmt">REPEAT statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">RESIGNAL</td>
|
|
<td align="left" valign="top" headers="wq1018">Resignals an error or warning condition</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstresignalstmt.htm#resignalstmt">RESIGNAL statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">RETURN</td>
|
|
<td align="left" valign="top" headers="wq1018">Returns from a routine</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstreturnstmt.htm#returnstmt">RETURN statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">SIGNAL</td>
|
|
<td align="left" valign="top" headers="wq1018">Signals an error or warning condition</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstsignalstmt.htm#signalstmt">SIGNAL statement</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1017">WHILE</td>
|
|
<td align="left" valign="top" headers="wq1018">Repeats the execution of a statement while
|
|
a specified condition is true</td>
|
|
<td align="left" valign="top" headers="wq1019"><a href="rbafzmstwhilestmt.htm#whilestmt">WHILE statement</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>See also:</p>
|
|
<ul>
|
|
<li><a href="rbafzmsthowsql.htm#howsql">How SQL statements are invoked</a></li>
|
|
<li><a href="rbafzmstcksql.htm#cksql">SQL return codes</a></li>
|
|
<li><a href="rbafzmstsqcomm.htm#sqcomm">SQL comments</a></li></ul>
|
|
<hr /><br />
|
|
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstintsel.htm">Previous Page</a> | <a href="rbafzmsthowsql.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>
|