doc-exports/docs/dws/dev/dws_06_0213.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
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>
2024-05-16 07:24:04 +00:00

33 lines
4.2 KiB
HTML

<a name="EN-US_TOPIC_0000001188270506"></a><a name="EN-US_TOPIC_0000001188270506"></a>
<h1 class="topictitle1">DROP TYPE</h1>
<div id="body1551942823551"><div class="section" id="EN-US_TOPIC_0000001188270506__sf1dc23c18c7e4d70ae11378c09434ef6"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188270506__p18120164041212"><strong id="EN-US_TOPIC_0000001188270506__b1965165715368">DROP TYPE</strong> deletes a user-defined data type. Only the type owner has permission to run this statement.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270506__sc2c25d4bda8c4a0aa855c4e6c11cfd96"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188270506__s8753f24fe4574929bfc89adff181c2cc"><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="k">TYPE</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="n">name</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_0000001188270506__se9dc7c333d594ed7a47947f536664d7e"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001188270506__ue8fc8b06575b44f68370320046cd75f4"><li id="EN-US_TOPIC_0000001188270506__l8704ee5944f14e99bc3412d35ba8c22c"><strong id="EN-US_TOPIC_0000001188270506__a065c167fb73f44cd807560bf5c50f4db">IF EXISTS</strong><p id="EN-US_TOPIC_0000001188270506__a46456dc5650e4817a87b7b955009dbba">Sends a notice instead of an error if the specified type does not exist.</p>
</li><li id="EN-US_TOPIC_0000001188270506__l5c2398ebb3fe4094ad541215353dcba5"><strong id="EN-US_TOPIC_0000001188270506__b8597214131">name</strong><p id="EN-US_TOPIC_0000001188270506__a485199a6506f4b5b8999d6a2fdd593a8">Specifies the name of the type to be deleted (schema-qualified).</p>
</li><li id="EN-US_TOPIC_0000001188270506__li2166102141312"><strong id="EN-US_TOPIC_0000001188270506__b51677212139">CASCADE</strong><p id="EN-US_TOPIC_0000001188270506__p1971524012136">Deletes objects (such as columns, functions, and operators) that depend on the type.</p>
<p id="EN-US_TOPIC_0000001188270506__p29574881416"><strong id="EN-US_TOPIC_0000001188270506__b11885161117159">RESTRICT</strong></p>
<p id="EN-US_TOPIC_0000001188270506__p132422139159">Refuses to delete the type if any objects depend on it. This is the default.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270506__sc542703eb3cb43f8ae9d632d3a9f8632"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188270506__p9736162517411">Delete the <strong id="EN-US_TOPIC_0000001188270506__b30200455433540">compfoo</strong> type:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188270506__screen367018422045"><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="k">TYPE</span><span class="w"> </span><span class="n">compfoo</span><span class="w"> </span><span class="k">cascade</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270506__s20e12635c85c42b5aefa8e0577b83fd3"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188270506__a385e1c05db244591beb008d61a8fba20"><a href="dws_06_0148.html">ALTER TYPE</a>, <a href="dws_06_0185.html">CREATE TYPE</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>