doc-exports/docs/dws/dev/dws_06_0192.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

36 lines
5.4 KiB
HTML

<a name="EN-US_TOPIC_0000001188270510"></a><a name="EN-US_TOPIC_0000001188270510"></a>
<h1 class="topictitle1">DROP FOREIGN TABLE</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188270510__scbdfabf1160f4ecda032220eb37b2a31"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188270510__ac08c96ad38884f26a81ec7128f413e4a"><strong id="EN-US_TOPIC_0000001188270510__b461094329394">DROP FOREIGN TABLE</strong> deletes a specified foreign table.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270510__s0d251591b57b48de9438cf4fa13ca625"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001188270510__a95998019848944b89f049ed1c8bb1a79"><strong id="EN-US_TOPIC_0000001188270510__b643393659394">DROP FOREIGN TABLE</strong> forcibly deletes a specified table. After a table is deleted, any indexes that exist for the table will be deleted. The functions and stored procedures used in this table cannot be run.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270510__s0ee3b55b618542fe87fc7d5ad1d03250"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188270510__s25097ab9872c4b858f38d878bf21d8f2"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">DROP</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">TABLE</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="w"> </span><span class="k">table_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_0000001188270510__seef5e7aa3440479d91aca927bc2e2d17"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001188270510__u7f6e176881bb4aab8cd7e0e24c3e276d"><li id="EN-US_TOPIC_0000001188270510__l9cdf5ec1d80042a98c593fd50a509805"><strong id="EN-US_TOPIC_0000001188270510__aee7ae9966eeb426fa93363d95f097b53">IF EXISTS</strong><p id="EN-US_TOPIC_0000001188270510__ab7715606f8a94300b192c612b6084aec">Sends a notice instead of an error if the specified table does not exist.</p>
</li><li id="EN-US_TOPIC_0000001188270510__l2d79a020013c47e7a356ecb049e165c8"><strong id="EN-US_TOPIC_0000001188270510__a5d0028bfa4094a669ddfe64a89ac2f98">table_name</strong><p id="EN-US_TOPIC_0000001188270510__a7134b7ebc8a24e2d9bbef94de5b02edf">Specifies the name of the foreign table to be deleted.</p>
<p id="EN-US_TOPIC_0000001188270510__adba6d349573740e7961df390b2019d69">Value range: An existing table name.</p>
</li><li id="EN-US_TOPIC_0000001188270510__ld4c61c0e63734886b85f88afdf687544"><strong id="EN-US_TOPIC_0000001188270510__a423b87ba2f6a41449f3d44ee9969b91e">CASCADE | RESTRICT</strong><ul id="EN-US_TOPIC_0000001188270510__ud3ca57d4426949f5b63359f1dcadfcc2"><li id="EN-US_TOPIC_0000001188270510__lf148afc35d58463a8df5b96f0899de10"><strong id="EN-US_TOPIC_0000001188270510__en-us_topic_0058965805_b842352706195927">CASCADE</strong>: automatically deletes all objects (such as views) that depend on the foreign table to be deleted.</li><li id="EN-US_TOPIC_0000001188270510__l0bee9dc8fefe4ae195d6a3de5ee4d89a"><strong id="EN-US_TOPIC_0000001188270510__b204818421916">RESTRICT</strong>: refuses to delete the foreign table if any objects depend on it. This is the default behaviour.</li></ul>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270510__s68b9b0b931f84ae8a8664f43b229d393"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188270510__p3761317182714">Delete the foreign table named <strong id="EN-US_TOPIC_0000001188270510__b148814331133635">customer_ft</strong>:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188270510__s015c8b1268f64a8bbeab76daabd0060c"><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">FOREIGN</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">customer_ft</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270510__s7b93f0e8ec89459fac83c12e6b6afa4f"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188270510__ab8962ad212cf4b309efb174c8a5cc8c2"><a href="dws_06_0123.html">ALTER FOREIGN TABLE (GDS Import and Export)</a>, <a href="dws_06_0124.html">ALTER FOREIGN TABLE (for HDFS or OBS)</a>, <a href="dws_06_0159.html">CREATE FOREIGN TABLE (for GDS Import and Export)</a>, <a href="dws_06_0161.html">CREATE FOREIGN TABLE (SQL on OBS or Hadoop)</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>