ibm-information-center/dist/eclipse/plugins/i5OS.ic.db2_5.4.0.1/rbafzmstsqlprocstmt.htm

134 lines
9.1 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="SQL-procedure-statement, SQL statements, labels,
scope of" />
<title>SQL-procedure-statement</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="sqlprocstmt"></a>
<h2 id="sqlprocstmt"><a href="rbafzmst02.htm#ToC_1407">SQL-procedure-statement</a></h2><a id="idx3324" name="idx3324"></a><a id="idx3325" name="idx3325"></a>
<p>An SQL control statement may allow multiple SQL statements to be specified
within the SQL control statement. These statements are defined as SQL procedure
statements.</p>
<a name="wq1845"></a>
<h3 id="wq1845"><a href="rbafzmst02.htm#ToC_1408">Syntax</a></h3>
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn405.htm"
border="0" /></span><a href="#skipsyn-404"><img src="c.gif" alt="Skip visual syntax diagram"
border="0" /></a> (1)
>>-+-<span class="italic">SQL-control-statement</span>-----------------------+------------->&lt;
+-<span><span class="italic">ALLOCATE DESCRIPTOR-statement</span></span>---------------+
+-<span class="italic">ALTER PROCEDURE (External)-statement</span>--------+
+-<span class="italic">ALTER SEQUENCE-statement</span>--------------------+
+-<span class="italic">ALTER TABLE-statement</span>-----------------------+
+-<span class="italic">CLOSE-statement</span>-----------------------------+
+-<span class="italic">COMMENT-statement</span>---------------------------+
+-<span class="italic">COMMIT-statement</span>----------------------------+
+-<span class="italic">CONNECT-statement</span>---------------------------+
+-<span class="italic">CREATE ALIAS-statement</span>----------------------+
+-<span class="italic">CREATE DISTINCT TYPE-statement</span>--------------+
+-<span class="italic">CREATE FUNCTION (External Scalar)-statement</span>-+
+-<span class="italic">CREATE FUNCTION (External Table)-statement</span>--+
+-<span class="italic">CREATE FUNCTION (Sourced)-statement</span>---------+
+-<span class="italic">CREATE INDEX-statement</span>----------------------+
+-<span class="italic">CREATE PROCEDURE (External)-statement</span>-------+
+-<span class="italic">CREATE SCHEMA-statement</span>---------------------+
+-<span class="italic">CREATE SEQUENCE-statement</span>-------------------+
+-<span class="italic">CREATE TABLE-statement</span>----------------------+
+-<span class="italic">CREATE VIEW-statement</span>-----------------------+
+-<span><span class="italic">DEALLOCATE DESCRIPTOR-statement</span></span>-------------+
+-<span class="italic">DECLARE GLOBAL TEMPORARY TABLE-statement</span>----+
+-<span class="italic">DELETE-statement</span>----------------------------+
+-<span><span class="italic">DESCRIBE-statement</span></span>--------------------------+
+-<span><span class="italic">DESCRIBE INPUT-statement</span></span>--------------------+
+-<span><span class="italic">DESCRIBE TABLE-statement</span></span>--------------------+
+-<span class="italic">DISCONNECT-statement</span>------------------------+
+-<span class="italic">DROP-statement</span>------------------------------+
+-<span class="italic">EXECUTE-statement</span>---------------------------+
+-<span class="italic">EXECUTE IMMEDIATE-statement</span>-----------------+
+-<span class="italic">FETCH-statement</span>-----------------------------+
+-<span><span class="italic">GET DESCRIPTOR-statement</span></span>--------------------+
+-<span class="italic">GRANT-statement</span>-----------------------------+
+-<span class="italic">INSERT-statement</span>----------------------------+
+-<span class="italic">LABEL-statement</span>-----------------------------+
+-<span class="italic">LOCK TABLE-statement</span>------------------------+
+-<span class="italic">OPEN-statement</span>------------------------------+
+-<span class="italic">PREPARE-statement</span>---------------------------+
+-<span class="italic">REFRESH TABLE-statement</span>---------------------+
+-<span class="italic">RELEASE-statement</span>---------------------------+
+-<span><span class="italic">RELEASE SAVEPOINT-statement</span></span>-----------------+
+-<span class="italic">RENAME-statement</span>----------------------------+
+-<span class="italic">REVOKE-statement</span>----------------------------+
+-<span class="italic">ROLLBACK-statement</span>--------------------------+
+-<span><span class="italic">SAVEPOINT-statement</span></span>-------------------------+
+-<span class="italic">SELECT INTO-statement</span>-----------------------+
+-<span class="italic">SET CONNECTION-statement</span>--------------------+
+-<span><span class="italic">SET CURRENT DEBUG MODE-statement</span></span>------------+
+-<span><span class="italic">SET CURRENT DEGREE-statement</span></span>----------------+
+-<span><span class="italic">SET DESCRIPTOR-statement</span></span>--------------------+
+-<span class="italic">SET ENCRYPTION PASSWORD-statement</span>-----------+
+-<span class="italic">SET PATH-statement</span>--------------------------+
+-<span class="italic">SET RESULT SETS-statement</span>-------------------+
+-<span class="italic">SET SCHEMA-statement</span>------------------------+
+-<span class="italic">SET TRANSACTION-statement</span>-------------------+
+-<span class="italic">UPDATE-statement</span>----------------------------+
'-<span class="italic">VALUES INTO-statement</span>-----------------------'
</pre>
<a name="skipsyn-404" id="skipsyn-404"></a>
<a name="wq1846"></a>
<div class="notelisttitle" id="wq1846">Notes:</div>
<ol type="1">
<li>COMMIT, ROLLBACK, CONNECT, DISCONNECT, SET CONNECTION, and SET RESULT
SETS statements are only allowed in SQL procedures. The SET TRANSACTION statement
is allowed in SQL procedures and triggers.</li>
</ol>
<a name="wq1848"></a>
<h3 id="wq1848"><a href="rbafzmst02.htm#ToC_1409">Notes</a></h3>
<p><span class="bold">Comments</span>: Comments can be included within the body
of an SQL procedure. In addition to the double-dash form of comments (--),
a comment can begin with /* and end with */. The following rules apply to <span>this form of a comment</span>. </p>
<ul>
<li>The beginning characters /* must be adjacent and on the same line.</li>
<li>The ending characters */ must be adjacent and on the same line.</li>
<li>Comments can be started wherever a space is valid.</li>
<li>Comments can be continued to the next line.</li></ul><a id="idx3326" name="idx3326"></a><a id="idx3327" name="idx3327"></a>
<a name="psscope"></a>
<p id="psscope"><span class="bold">Labels</span>:
Labels can be specified on most SQL procedure statements. If a label is specified
on an SQL procedure statement, it must be unique from other labels within
the same scope. </p>
<ul>
<li>The label must not be the same as any other label within the same <span class="italic">compound-statement</span>.</li>
<li>The label must not be the same as a label specified on the <span class="italic">compound-statement</span> itself.</li>
<li>If the <span class="italic">compound-statement</span> is nested within another <span class="italic">compound-statement</span>, the label must not be the same as
the label specified on any higher level <span class="italic">compound-statement</span>.</li>
<li>The label must not be the same as the name of the SQL function, SQL procedure,
or SQL trigger that contains the SQL procedure statement.</li></ul>
<hr /><br />
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstrefsqlv.htm">Previous Page</a> | <a href="rbafzmstassignstmt.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>