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>
34 lines
4.8 KiB
HTML
34 lines
4.8 KiB
HTML
<a name="EN-US_TOPIC_0000001233510141"></a><a name="EN-US_TOPIC_0000001233510141"></a>
|
|
|
|
<h1 class="topictitle1">DROP SEQUENCE</h1>
|
|
<div id="body1494377960800"><div class="section" id="EN-US_TOPIC_0000001233510141__s7dd20c9b0a334b13a7608e4903f96798"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001233510141__adf7229d5e2214b4588ff2828909c0192"><strong id="EN-US_TOPIC_0000001233510141__b842352706101223">DROP SEQUENCE</strong> deletes a sequence from the current database.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510141__sdd7209cebe324b6cb708eeaae2ba2b22"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001233510141__a857aca2ea52f428c85812c82e77036e5">Only a sequence owner or a system administrator can delete a sequence.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510141__sdb11892dbbf04adfae50a76a5a6b1a05"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233510141__sdf16a297d3c842988380a7009ed3f9d9"><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="k">DROP</span><span class="w"> </span><span class="n">SEQUENCE</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">IF</span><span class="w"> </span><span class="k">EXISTS</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="err">{</span><span class="p">[</span><span class="k">schema</span><span class="p">.]</span><span class="n">sequence_name</span><span class="err">}</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">,</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">CASCADE</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">RESTRICT</span><span class="w"> </span><span class="p">];</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510141__s8f99d57e30a24c10bd0924879dafa9d1"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001233510141__ua507a28d182f475ea943d82f548690cd"><li id="EN-US_TOPIC_0000001233510141__l830b1294728c42f4ba248be37b969fc0"><strong id="EN-US_TOPIC_0000001233510141__en-us_topic_0059778402_b692624943414">IF EXISTS</strong><p id="EN-US_TOPIC_0000001233510141__a802e9375944e4395888aafde9c94ca36">Sends a notice instead of an error if the specified sequence does not exist. </p>
|
|
</li><li id="EN-US_TOPIC_0000001233510141__lc1b9c523b25846c6ac92213ac20acdd5"><strong id="EN-US_TOPIC_0000001233510141__a898a8468d4a740c5b2396f6e10f6c420">name</strong><p id="EN-US_TOPIC_0000001233510141__a502f759343e3462d866716eef0c7cf84">Specifies the name of the sequence.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233510141__l63ae361e37b54f759784bf593e19a231"><strong id="EN-US_TOPIC_0000001233510141__afdba785bd993440181d2049f7f6f257e">CASCADE</strong><p id="EN-US_TOPIC_0000001233510141__a8caa6e7ecb83473fb226528528672552">Automatically deletes objects that depend on the sequence to be deleted.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233510141__en-us_topic_0059778402_li79268495341"><strong id="EN-US_TOPIC_0000001233510141__en-us_topic_0059778402_b789012440387">RESTRICT</strong><p id="EN-US_TOPIC_0000001233510141__ae4d5c2daf9e642b0998dadca4db30210">Refuses to delete the sequence if any objects depend on it. This is the default.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510141__sc0d5efe84f2347028f38832257efe89d"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001233510141__p144831643144915">Delete the sequence <strong id="EN-US_TOPIC_0000001233510141__b138864207177">serial</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233510141__sff475d75393b4fb2b2d363985303aad1"><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="k">DROP</span><span class="w"> </span><span class="n">SEQUENCE</span><span class="w"> </span><span class="nb">serial</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510141__s1af184a28a2f43c7804310d4c6a74645"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001233510141__a25be806ba5b04c278a619d104fade327"><a href="dws_06_0174.html">CREATE SEQUENCE</a> <a href="dws_06_0137.html">ALTER SEQUENCE</a></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0118.html">DDL Syntax</a></div>
|
|
</div>
|
|
</div>
|
|
|