131 lines
8.2 KiB
HTML
131 lines
8.2 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="DISCONNECT statement, DISCONNECT, SQL statements,
|
||
|
disconnecting SQL objects, in DISCONNECT statement, server-name, variable,
|
||
|
CURRENT clause, ALL clause, ALL SQL clause, SQL (Structured Query Language)" />
|
||
|
<title>DISCONNECT</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="discon"></a>
|
||
|
<h2 id="discon"><a href="rbafzmst02.htm#ToC_1037">DISCONNECT</a></h2><a id="idx2467" name="idx2467"></a><a id="idx2468" name="idx2468"></a><a id="idx2469" name="idx2469"></a>
|
||
|
<a name="disconj"></a>
|
||
|
<p id="disconj">The DISCONNECT statement ends one or more connections for
|
||
|
unprotected conversations.</p>
|
||
|
<a name="wq1466"></a>
|
||
|
<h3 id="wq1466"><a href="rbafzmst02.htm#ToC_1038">Invocation</a></h3>
|
||
|
<p>This statement can only be embedded in an application program or issued
|
||
|
interactively. It is an executable statement that cannot be dynamically prepared.
|
||
|
It must not be specified in Java™ or REXX.</p>
|
||
|
<p>DISCONNECT is not allowed in a trigger. DISCONNECT is not allowed in an
|
||
|
external procedure if the external procedure is called on a remote application server.</p>
|
||
|
<a name="wq1467"></a>
|
||
|
<h3 id="wq1467"><a href="rbafzmst02.htm#ToC_1039">Authorization</a></h3>
|
||
|
<p>None required.</p>
|
||
|
<a name="wq1468"></a>
|
||
|
<h3 id="wq1468"><a href="rbafzmst02.htm#ToC_1040">Syntax</a></h3>
|
||
|
<a href="rbafzmstdiscon.htm#synsdisconnect"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
|
||
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn332.htm"
|
||
|
border="0" /></span><a href="#skipsyn-331"><img src="c.gif" alt="Skip visual syntax diagram"
|
||
|
border="0" /></a>>>-DISCONNECT--+-<span class="italic">server-name</span>--+--------------------------------><
|
||
|
+-<span><span class="italic">variable</span></span>-----+
|
||
|
+-CURRENT------+
|
||
|
| .-SQL-. |
|
||
|
'-ALL--+-----+-'
|
||
|
|
||
|
</pre>
|
||
|
<a name="skipsyn-331" id="skipsyn-331"></a>
|
||
|
<a name="synsdisconnect"></a>
|
||
|
<h3 id="synsdisconnect"><a href="rbafzmst02.htm#ToC_1041">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="idx2470" name="idx2470"></a><a id="idx2471" name="idx2471"></a>
|
||
|
<dd>Identifies the application server 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 DISCONNECT statement is executed, the specified server name
|
||
|
or server name contained in the variable must identify an existing dormant
|
||
|
or current connection of the activation group. The identified connection cannot
|
||
|
use a protected conversation.</p>
|
||
|
</dd>
|
||
|
<dt class="bold">CURRENT </dt><a id="idx2472" name="idx2472"></a>
|
||
|
<dd>Identifies the current connection of the activation group. The activation
|
||
|
group must be in the connected state. The current connection must not use
|
||
|
a protected conversation.
|
||
|
</dd>
|
||
|
<dt class="bold">ALL <span class="base">or</span> ALL SQL </dt><a id="idx2473" name="idx2473"></a><a id="idx2474" name="idx2474"></a>
|
||
|
<dd>Identifies all existing connections of the activation group (local as
|
||
|
well as remote connections). An error or warning does not occur if no connections
|
||
|
exist when the statement is executed. None of the connections can use protected
|
||
|
conversations.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<a name="wq1469"></a>
|
||
|
<h3 id="wq1469"><a href="rbafzmst02.htm#ToC_1042">Notes</a></h3>
|
||
|
<p><span class="bold">DISCONNECT and CONNECT (Type 1):</span> Using CONNECT (Type
|
||
|
1) semantics does not prevent using DISCONNECT.</p>
|
||
|
<p><span class="bold">Connection restrictions:</span> An identified connection
|
||
|
must not be a connection that was used to execute SQL statements during the
|
||
|
current unit of work and must not be a connection for a protected conversation.
|
||
|
To end connections on protected conversations, use the RELEASE statement.
|
||
|
Local connections are never considered to be protected conversations.</p>
|
||
|
<p>The DISCONNECT statement should be executed immediately after a commit
|
||
|
operation. If DISCONNECT is used to end the current connection, the next executed
|
||
|
SQL statement must be CONNECT or SET CONNECTION.</p>
|
||
|
<p>ROLLBACK does not reconnect a connection that has been ended by DISCONNECT.</p>
|
||
|
<p><span class="bold">Successful disconnect:</span> If the DISCONNECT statement
|
||
|
is successful, each identified connection is ended. If the current connection
|
||
|
is destroyed, the activation group is placed in the unconnected state.</p>
|
||
|
<p>DISCONNECT closes cursors, releases resources, and prevents further use
|
||
|
of the connection.</p>
|
||
|
<p>DISCONNECT ALL ends the connection to the local application server. A connection
|
||
|
is ended even though it has an open cursor defined with the WITH HOLD clause.</p>
|
||
|
<p><span class="bold">Unsuccessful disconnect:</span> If the DISCONNECT statement
|
||
|
is unsuccessful, the connection state of the activation group and the states
|
||
|
of its connections are unchanged.</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 ended as soon as possible and a remote
|
||
|
connection that is going to be reused should not be destroyed.</p>
|
||
|
<a name="wq1470"></a>
|
||
|
<h3 id="wq1470"><a href="rbafzmst02.htm#ToC_1043">Examples</a></h3>
|
||
|
<p><span class="italic">Example 1</span>: The connection to TOROLAB1 is no longer
|
||
|
needed. The following statement is executed after a commit operation. </p>
|
||
|
<pre class="xmp"> EXEC SQL <span class="bold">DISCONNECT</span> TOROLAB1;</pre><p class="indatacontent"> <span class="italic">Example 2</span>: The current connection is no longer needed. The following
|
||
|
statement is executed after a commit operation. </p>
|
||
|
<pre class="xmp"> EXEC SQL <span class="bold">DISCONNECT CURRENT</span>;</pre><p class="indatacontent"> <span class="italic">Example 3</span>: The existing
|
||
|
connections are no longer needed. The following statement is executed after
|
||
|
a commit operation. </p>
|
||
|
<pre class="xmp"> EXEC SQL <span class="bold">DISCONNECT ALL</span>;</pre><a id="idx2475" name="idx2475"></a><a id="idx2476" name="idx2476"></a><a id="idx2477" name="idx2477"></a><a id="idx2478" name="idx2478"></a>
|
||
|
<hr /><br />
|
||
|
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstdescrtb.htm">Previous Page</a> | <a href="rbafzmstdropst.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>
|