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

128 lines
7.8 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))' />
<meta name="keywords" content="RELEASE statement, RELEASE, SQL statements,
releasing, connection, ending, trigger, procedure, in RELEASE statement,
server-name, variable, CURRENT clause, ALL clause, ALL SQL clause" />
<title>RELEASE (Connection)</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="rele"></a>
<h2 id="rele"><a href="rbafzmst02.htm#ToC_1198">RELEASE (Connection)</a></h2><a id="idx2979" name="idx2979"></a><a id="idx2980" name="idx2980"></a><a id="idx2981" name="idx2981"></a><a id="idx2982" name="idx2982"></a>
<a name="relsj"></a>
<p id="relsj">The RELEASE statement places one or more connections in the release-pending state.</p>
<a name="wq1667"></a>
<h3 id="wq1667"><a href="rbafzmst02.htm#ToC_1199">Invocation</a></h3>
<p>This statement can only be embedded within an application program or issued
interactively. It is an executable statement that cannot be dynamically prepared.
It must not be specified in Java&trade; or REXX.</p><a id="idx2983" name="idx2983"></a><a id="idx2984" name="idx2984"></a>
<p>RELEASE is not allowed in a trigger. RELEASE is not allowed in an external
procedure if the external procedure is called on a remote application server.</p>
<a name="wq1668"></a>
<h3 id="wq1668"><a href="rbafzmst02.htm#ToC_1200">Authorization</a></h3>
<p>None required.</p>
<a name="wq1669"></a>
<h3 id="wq1669"><a href="rbafzmst02.htm#ToC_1201">Syntax</a></h3>
<a href="rbafzmstrele.htm#synsrelease"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn364.htm"
border="0" /></span><a href="#skipsyn-363"><img src="c.gif" alt="Skip visual syntax diagram"
border="0" /></a>>>-RELEASE--+-<span class="italic">server-name</span>--+----------------------------------->&lt;
+-<span><span class="italic">variable</span></span>-----+
+-CURRENT------+
| .-SQL-. |
'-ALL--+-----+-'
</pre>
<a name="skipsyn-363" id="skipsyn-363"></a>
<a name="synsrelease"></a>
<h3 id="synsrelease"><a href="rbafzmst02.htm#ToC_1202">Description</a></h3>
<dl class="parml">
<dt class="bold"><var class="pv">server-name</var> <span class="base">or</span> <var class="pv">variable</var> </dt><a id="idx2985" name="idx2985"></a><a id="idx2986" name="idx2986"></a>
<dd>Identifies a connection by the specified server name or the server name
contained in the variable. If a variable is specified:
<ul>
<li>It must be a character-string variable.</li>
<li>It must not be followed by an indicator variable.</li>
<li>The server name must be left-justified within the variable and must conform
to the rules for forming an ordinary identifier.</li>
<li>If the length of the server name is less than the length of the variable,
it must be padded on the right with blanks.</li></ul>
<p>When the RELEASE statement is executed, the specified server name
or the server name contained in the variable must identify an existing connection
of the activation group.</p>
</dd>
<dt class="bold">CURRENT </dt><a id="idx2987" name="idx2987"></a>
<dd>Identifies the current connection of the activation group. The activation
group must be in the connected state.
</dd>
<dt class="bold">ALL <span class="base">or</span> ALL SQL </dt><a id="idx2988" name="idx2988"></a><a id="idx2989" name="idx2989"></a>
<dd>Identifies all existing connections of the activation group (local as
well as remote connections).
<p>An error or warning does not occur if no connections
exist when the statement is executed.</p>
</dd>
</dl>
<p>If the RELEASE statement is successful, each identified connection is placed
in the release-pending state and will therefore be ended during the next commit operation.
If the RELEASE statement is unsuccessful, the connection state of the activation
group and the states of its connections are unchanged.</p>
<a name="wq1670"></a>
<h3 id="wq1670"><a href="rbafzmst02.htm#ToC_1203">Notes</a></h3>
<p><span class="bold">RELEASE and CONNECT (Type 1):</span> Using CONNECT (Type
1) semantics does not prevent using RELEASE.</p>
<p><span class="bold">Scope of RELEASE:</span> RELEASE does not close cursors,
does not release any resources, and does not prevent further use of the connection.</p>
<p><span class="bold">Resource considerations for remote connections:</span> Resources
are required to create and maintain remote connections. Thus, a remote connection
that is not going to be reused should be in the release-pending state and one that
is going to be reused should not be in the release-pending state.</p>
<p><span class="bold">Connection states:</span> ROLLBACK does not reset the state
of a connection from release-pending to held.</p>
<p>If the current connection is in the release-pending state when a commit operation
is performed, the connection is ended and the activation group is in the unconnected
state. In this case, the next executed SQL statement must be CONNECT or SET
CONNECTION.</p>
<p>RELEASE ALL places the connection to the local application server in the release-pending state.
A connection in the release-pending state is ended during a commit operation even
though it has an open cursor defined with the WITH HOLD clause.</p>
<a name="wq1671"></a>
<h3 id="wq1671"><a href="rbafzmst02.htm#ToC_1204">Examples</a></h3>
<p><span class="italic">Example 1</span>: The connection to TOROLAB1 is not needed
in the next unit of work. The following statement will cause it to be ended
during the next commit operation. </p>
<pre class="xmp"> EXEC SQL <span class="bold">RELEASE</span> TOROLAB1;</pre>
<p><span class="italic">Example 2</span>: The current connection is not needed
in the next unit of work. The following statement will cause it to be ended
during the next commit operation. </p>
<pre class="xmp"> EXEC SQL <span class="bold">RELEASE CURRENT</span>;</pre>
<p><span class="italic">Example 3</span>: None of the existing connections are
needed in the next unit of work. The following statement will cause it to
be ended during the next commit operation. </p>
<pre class="xmp"> EXEC SQL <span class="bold">RELEASE ALL</span>;</pre><a id="idx2990" name="idx2990"></a><a id="idx2991" name="idx2991"></a>
<hr /><br />
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmsthrefresh.htm">Previous Page</a> | <a href="rbafzmstrlssvpt.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>