forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
45 lines
5.9 KiB
HTML
45 lines
5.9 KiB
HTML
<a name="EN-US_TOPIC_0000001188110514"></a><a name="EN-US_TOPIC_0000001188110514"></a>
|
|
|
|
<h1 class="topictitle1">RELEASE SAVEPOINT</h1>
|
|
<div id="body1494377960801"><div class="section" id="EN-US_TOPIC_0000001188110514__s47c1420dda6f4d5b8c873b52f6cdf248"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188110514__aa5dbaa42290f41c181d70394e32186f9"><strong id="EN-US_TOPIC_0000001188110514__b842352706173612">RELEASE SAVEPOINT</strong> destroys a savepoint previously defined in the current transaction.</p>
|
|
<p id="EN-US_TOPIC_0000001188110514__a7657105b781a48779748219283734d43">Destroying a savepoint makes it unavailable as a rollback point, but it has no other user visible behavior. It does not undo the effects of commands executed after the savepoint was established. To do that, use <strong id="EN-US_TOPIC_0000001188110514__b842352706174916">ROLLBACK TO SAVEPOINT</strong>. Destroying a savepoint when it is no longer needed allows the system to reclaim some resources earlier than transaction end.</p>
|
|
<p id="EN-US_TOPIC_0000001188110514__ab6292346ba5a464e86aaf894a9687438"><strong id="EN-US_TOPIC_0000001188110514__b365893614175025">RELEASE SAVEPOINT</strong> also destroys all savepoints that were established after the named savepoint was established.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188110514__sdae291a7a845490eaf31e8c32fb38c92"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001188110514__ua23d39ed752a44ac8470389f27b69d06"><li id="EN-US_TOPIC_0000001188110514__l394ca3d78d344ddba55a6aeb7d825460">Releasing a savepoint name that was not previously defined causes an error.</li><li id="EN-US_TOPIC_0000001188110514__l8659fefab6034805bde17cac8c532bcb">It is not possible to release a savepoint when the transaction is in an aborted state.</li><li id="EN-US_TOPIC_0000001188110514__l4f80e9c259f1488a8efde13d8486f99c">If multiple savepoints have the same name, only the one that was most recently defined is released.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188110514__sc0bd1360845746a9a3acbb35255dbe42"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188110514__sf8dfad4b063c4ce98be1069a65290d45"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">RELEASE</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="n">SAVEPOINT</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="n">savepoint_name</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188110514__s54e291c038814843847b9bc15242cd25"><h4 class="sectiontitle">Parameter Description</h4><p id="EN-US_TOPIC_0000001188110514__en-us_topic_0059778044_p107345163227"><strong id="EN-US_TOPIC_0000001188110514__b8301214135112">savepoint_name</strong></p>
|
|
<p id="EN-US_TOPIC_0000001188110514__a777662366793480885c261278e8d6912">Specifies the name of the savepoint you want to destroy.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188110514__section179621618132712"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188110514__p18774155619340">Create and then destroy a savepoint:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188110514__screen296221822719"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">BEGIN</span><span class="p">;</span>
|
|
<span class="w"> </span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="k">IF</span><span class="w"> </span><span class="k">NOT</span><span class="w"> </span><span class="k">EXISTS</span><span class="w"> </span><span class="n">table1</span><span class="w"> </span><span class="p">(</span><span class="n">a</span><span class="w"> </span><span class="nb">int</span><span class="p">,</span><span class="n">b</span><span class="w"> </span><span class="nb">int</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">table1</span><span class="w"> </span><span class="k">VALUES</span><span class="w"> </span><span class="p">(</span><span class="mi">3</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="n">SAVEPOINT</span><span class="w"> </span><span class="n">my_savepoint</span><span class="p">;</span>
|
|
<span class="w"> </span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">table1</span><span class="w"> </span><span class="k">VALUES</span><span class="w"> </span><span class="p">(</span><span class="mi">4</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="n">RELEASE</span><span class="w"> </span><span class="n">SAVEPOINT</span><span class="w"> </span><span class="n">my_savepoint</span><span class="p">;</span>
|
|
<span class="k">COMMIT</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188110514__s79cfa451c61c4fe1b4bd37e9cc30d732"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188110514__aeced1b5c203c49bf9687f0093d614203"><a href="dws_06_0263.html">SAVEPOINT</a>, <a href="dws_06_0269.html">ROLLBACK TO SAVEPOINT</a></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0254.html">TCL Syntax</a></div>
|
|
</div>
|
|
</div>
|
|
|