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>
39 lines
6.7 KiB
HTML
39 lines
6.7 KiB
HTML
<a name="EN-US_TOPIC_0000001188270526"></a><a name="EN-US_TOPIC_0000001188270526"></a>
|
|
|
|
<h1 class="topictitle1">DROP FUNCTION</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188270526__sc5864afbaebc45009579a9b703ffe446"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188270526__a6f6d91c3b7b44822891b8789e35171e2"><strong id="EN-US_TOPIC_0000001188270526__b246380349438">DROP FUNCTION</strong> deletes an existing function.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188270526__sc24f0f47486143ee96264a977a17c1ba"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001188270526__ul11839734719"><li id="EN-US_TOPIC_0000001188270526__li475917481620">To delete an overloaded function, you must specify the function's parameter type. For non-overloaded functions, you can delete them by just specifying the function name.</li><li id="EN-US_TOPIC_0000001188270526__li18953711103213">If a function involves operations on temporary tables, the function cannot be deleted by running <strong id="EN-US_TOPIC_0000001188270526__b9716204716820">DROP FUNCTION</strong>.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188270526__s547bbada4c304ce983cc3503613b5ad1"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188270526__s8ccde0847c3a42c6950767fe87e4de24"><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">FUNCTION</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">function_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="err">{</span><span class="p">[</span><span class="w"> </span><span class="n">argmode</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="n">argname</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="n">argtype</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><span class="w"> </span><span class="p">];</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188270526__sfc3a903547b5434aae0953a42de51abe"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001188270526__u88ddf0dcad9640c199020e18ba905595"><li id="EN-US_TOPIC_0000001188270526__l4ca316354c624a839c04044aea30de89"><strong id="EN-US_TOPIC_0000001188270526__a9787634f7e604930b0e78ef78087757a">IF EXISTS</strong><p id="EN-US_TOPIC_0000001188270526__a53305717b6d541d7811ef1b7dff6e94a">Sends a notice instead of an error if the specified function does not exist.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188270526__l082300b7bb6b4e79a76d8bd7f643035d"><strong id="EN-US_TOPIC_0000001188270526__a516a38131f3f49d8b07047abf0bef948">function_name</strong><p id="EN-US_TOPIC_0000001188270526__a4de8c07069ed4eee901177c3277fe5e0">Specifies the name of the function to be deleted.</p>
|
|
<p id="EN-US_TOPIC_0000001188270526__a51bee8d013454f71b7bb31b488b7541c">Value range: An existing function name.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188270526__l85b2b916d6bf44c682978b9b8d740ade"><strong id="EN-US_TOPIC_0000001188270526__a648a0d0104e44a0d8ee391fcd9209f9b">argmode</strong><p id="EN-US_TOPIC_0000001188270526__aae7badf2456b4f87a059949427c5bb2a">Specifies the mode of a function parameter.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188270526__l34daa38b87ba4aac949e65494ec9d232"><strong id="EN-US_TOPIC_0000001188270526__ab64a5e00f0904088a26845fbe3714afa">argname</strong><p id="EN-US_TOPIC_0000001188270526__a596811e71ec446449a11248addd24a33">Specifies the name of a function parameter.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188270526__l5fa7165b2d9c49c786dd81879cb44b4b"><strong id="EN-US_TOPIC_0000001188270526__a4950440fbfaf4527947ddeafc81a68eb">argtype</strong><p id="EN-US_TOPIC_0000001188270526__a0a39bb80afbf4b438b96c8ddb09768bd">Specifies the data types of a function parameter.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188270526__l6b6c3aade1224e37a40810d60be41e23"><strong id="EN-US_TOPIC_0000001188270526__a2e315073a2e741d9a7a147444eb41c90">CASCADE | RESTRICT</strong><ul id="EN-US_TOPIC_0000001188270526__u29493d9969a74d27a9fa4fa02bd43d79"><li id="EN-US_TOPIC_0000001188270526__l8cca1315a4d4416aab3c651a7b28eebb"><strong id="EN-US_TOPIC_0000001188270526__b842352706124820">CASCADE</strong>: automatically deletes all objects that depend on the function to be deleted (such as operators).</li><li id="EN-US_TOPIC_0000001188270526__l13ee64cf2e8f40b0a971bb80ee06aa2e"><strong id="EN-US_TOPIC_0000001188270526__b842352706124830">RESTRICT</strong>: refuses to delete the function if any objects depend on it. This is the default.</li></ul>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188270526__saa7b8584a6444344b52006b668c5223c"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188270526__p1948144914415">Delete a function named <strong id="EN-US_TOPIC_0000001188270526__b59441608333247">add_two_number</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188270526__screen173549324443"><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">FUNCTION</span><span class="w"> </span><span class="n">add_two_number</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188270526__s63cfe3eb965049f7873eb77b5af03d5c"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188270526__a44157e88dc674ab695b299712e0bd650"><a href="dws_06_0126.html">ALTER FUNCTION</a>, <a href="dws_06_0163.html">CREATE FUNCTION</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>
|
|
|