1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>CLOSE</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="sql-commands.html" title="SQL Commands">
<link rel="prev" href="sql-checkpoint.html" title="CHECKPOINT">
<link rel="next" href="sql-cluster.html" title="CLUSTER">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="sql-close"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>CLOSE — close a cursor</p>
</div>
<a name="id748645"></a><a name="id748656"></a><div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">CLOSE <em class="replaceable"><code>name</code></em></pre>
</div>
<div class="refsect1" lang="en">
<a name="id748680"></a><h2>Description</h2>
<p> <code class="command">CLOSE</code> frees the resources associated with an open cursor.
After the cursor is closed, no subsequent operations
are allowed on it. A cursor should be closed when it is
no longer needed.
</p>
<p> Every non-holdable open cursor is implicitly closed when a
transaction is terminated by <code class="command">COMMIT</code> or
<code class="command">ROLLBACK</code>. A holdable cursor is implicitly
closed if the transaction that created it aborts via
<code class="command">ROLLBACK</code>. If the creating transaction successfully
commits, the holdable
cursor remains open until an explicit <code class="command">CLOSE</code> is
executed, or the client disconnects.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id748731"></a><h2>Parameters</h2>
<div class="variablelist"><dl>
<dt><span class="term"><em class="replaceable"><code>name</code></em></span></dt>
<dd><p> The name of an open cursor to close.
</p></dd>
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id748748"></a><h2>Notes</h2>
<p> <span class="productname">PostgreSQL</span> does not have an explicit
<code class="command">OPEN</code> cursor statement; a cursor is considered
open when it is declared. Use the
<a href="sql-declare.html">DECLARE</a>
statement to declare a cursor.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id748784"></a><h2>Examples</h2>
<p> Close the cursor <code class="literal">liahona</code>:
</p>
<pre class="programlisting">CLOSE liahona;</pre>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id748804"></a><h2>Compatibility</h2>
<p> <code class="command">CLOSE</code> is fully conforming with the SQL standard.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id748817"></a><h2>See Also</h2>
<span class="simplelist"><a href="sql-declare.html">DECLARE</a>, <a href="sql-fetch.html">FETCH</a>, <a href="sql-move.html">MOVE</a></span>
</div>
</div></body>
</html>
|