640 lines
42 KiB
HTML
640 lines
42 KiB
HTML
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="dc.language" scheme="rfc1766" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<meta name="dc.date" scheme="iso8601" content="2005-09-19" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow"/>
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="keywords" content="DROP statement, DROP, SQL statements,
|
||
|
deleting SQL objects, ALIAS clause, in DROP statement, alias-name, dropping,
|
||
|
alias, TYPE clause, distinct-type-name, CASCADE clause, RESTRICT clause, type,
|
||
|
FUNCTION clause, function-name, SPECIFIC clause, specific-name, function,
|
||
|
INDEX clause, index-name, index, PACKAGE clause, package-name, package,
|
||
|
PROCEDURE clause, procedure-name, procedure, table, SCHEMA clause, schema,
|
||
|
schema-name, SEQUENCE clause, sequence-name, sequence, TABLE clause, table-name,
|
||
|
TRIGGER clause, trigger-name, trigger, VIEW clause, view-name, view,
|
||
|
SQL (Structured Query Language)" />
|
||
|
<title>DROP</title>
|
||
|
<link rel="stylesheet" type="text/css" href="ibmidwb.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="ic.css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<a id="Top_Of_Page" name="Top_Of_Page"></a><!-- Java sync-link -->
|
||
|
<script language = "Javascript" src = "../rzahg/synch.js" type="text/javascript"></script>
|
||
|
|
||
|
|
||
|
<a name="dropst"></a>
|
||
|
<h2 id="dropst"><a href="rbafzmst02.htm#ToC_1044">DROP</a></h2><a id="idx2479" name="idx2479"></a><a id="idx2480" name="idx2480"></a><a id="idx2481" name="idx2481"></a>
|
||
|
<a name="drop"></a>
|
||
|
<p id="drop">The DROP statement drops an object. Objects that are directly
|
||
|
or indirectly dependent on that object may also be dropped.</p>
|
||
|
<a name="wq1471"></a>
|
||
|
<h3 id="wq1471"><a href="rbafzmst02.htm#ToC_1045">Invocation</a></h3>
|
||
|
<p>This statement can be embedded in an application program or issued interactively.
|
||
|
It is an executable statement that can be dynamically prepared.</p>
|
||
|
<a name="wq1472"></a>
|
||
|
<h3 id="wq1472"><a href="rbafzmst02.htm#ToC_1046">Authorization</a></h3>
|
||
|
<p>To drop a table, view, index, alias, or package, the privileges held by
|
||
|
the authorization ID of the statement must include at least one of the following: </p>
|
||
|
<ul>
|
||
|
<li>The following system authorities:
|
||
|
<ul>
|
||
|
<li>The system authorities of *OBJOPR and *OBJEXIST on the object to be dropped</li>
|
||
|
<li>If the object is a table or view, the system authorities of *OBJOPR and
|
||
|
*OBJEXIST on any views, indexes, and logical files that are dependent on that
|
||
|
table or view</li>
|
||
|
<li>The system authority *EXECUTE on the library that contains the object
|
||
|
to be dropped</li></ul></li>
|
||
|
<li>Administrative authority</li></ul>
|
||
|
<p>To drop a schema, the privileges held by the authorization ID of the statement
|
||
|
must include at least one of the following: </p>
|
||
|
<ul>
|
||
|
<li>The following system authorities:
|
||
|
<ul>
|
||
|
<li>The system authorities of *OBJEXIST, *OBJOPR, *EXECUTE, and *READ on the
|
||
|
library to be dropped.</li>
|
||
|
<li>The system authorities of *OBJOPR and *OBJEXIST on all objects in the
|
||
|
schema and *OBJOPR and *OBJEXIST on any views, indexes and logical files that
|
||
|
are dependent on tables and views in the schema.</li>
|
||
|
<li>Any additional authorities required to delete other object types that
|
||
|
exist in the schema. For example, *OBJMGT to the data dictionary if the schema
|
||
|
contains a data dictionary, and some system data authority to the journal
|
||
|
receiver. For more information, see the <a href="../books/sc415302.pdf" target="_blank">iSeries Security
|
||
|
Reference</a>
|
||
|
<img src="wbpdf.gif" alt="Link to PDF" /> book.</li></ul></li>
|
||
|
<li>Administrative authority</li></ul>
|
||
|
<p>To drop a distinct type, the privileges held by the authorization ID of the statement
|
||
|
must include at least one of the following: </p>
|
||
|
<ul>
|
||
|
<li>The following system authorities:
|
||
|
<ul>
|
||
|
<li>The system authorities of *OBJOPR and *OBJEXIST on the distinct type to be dropped</li>
|
||
|
<li>The system authority *EXECUTE on the library that contains the distinct type to
|
||
|
be dropped</li>
|
||
|
<li>The DELETE privilege on the SYSTYPES, SYSPARMS, and SYSROUTINES catalog
|
||
|
tables, and</li>
|
||
|
<li>The system authority *EXECUTE on library QSYS2</li></ul></li>
|
||
|
<li>Administrative authority</li></ul>
|
||
|
<p>To drop a function, the privileges held by the authorization ID of the
|
||
|
statement must include at least one of the following: </p>
|
||
|
<ul>
|
||
|
<li>The following system authorities:
|
||
|
<ul>
|
||
|
<li>For SQL functions, the system authority *OBJEXIST on the service program
|
||
|
object associated with the function, and</li>
|
||
|
<li>The DELETE privilege on the SYSFUNCS, SYSPARMS, and SYSROUTINEDEP
|
||
|
catalog tables, and</li>
|
||
|
<li>The system authority *EXECUTE on library QSYS2</li></ul></li>
|
||
|
<li>Administrative authority</li></ul>
|
||
|
<p>To drop a procedure, the privileges held by the authorization ID of the
|
||
|
statement must include at least one of the following: </p>
|
||
|
<ul>
|
||
|
<li>The following system authorities:
|
||
|
<ul>
|
||
|
<li>For SQL procedures, the system authority *OBJEXIST on the program object
|
||
|
associated with the procedure, and</li>
|
||
|
<li>The DELETE privilege on the SYSPROCS, SYSPARMS, and SYSROUTINEDEP
|
||
|
catalog tables, and</li>
|
||
|
<li>The system authority *EXECUTE on library QSYS2</li></ul></li>
|
||
|
<li>Administrative authority</li></ul>
|
||
|
<p>To drop a sequence, the privileges held by the authorization ID of the
|
||
|
statement must include at least one of the following: </p>
|
||
|
<ul>
|
||
|
<li>The following system authorities:
|
||
|
<ul>
|
||
|
<li>The system authority *OBJEXIST on the data area associated with the sequence,
|
||
|
and</li>
|
||
|
<li>The system authority *EXECUTE on the library that contains
|
||
|
the sequence to be dropped</li>
|
||
|
<li>The DELETE privilege on the SYSSEQOBJECTS catalog table, and</li>
|
||
|
<li>The system authority *EXECUTE on library QSYS2, and</li>
|
||
|
<li>*USE to the Delete Data Area (DLTDTAARA) command</li></ul></li>
|
||
|
<li>Administrative authority</li></ul>
|
||
|
<p>To drop a trigger, the privileges held by the authorization ID of the statement
|
||
|
must include at least one of the following: </p>
|
||
|
<ul>
|
||
|
<li>The following privileges:
|
||
|
<ul>
|
||
|
<li>The system authority *USE to the Remove Physical File Trigger (RMVPFTRG)
|
||
|
command, and</li>
|
||
|
<li>For the subject table or view of the trigger:
|
||
|
<ul>
|
||
|
<li>The ALTER privilege to the subject table or view, and</li>
|
||
|
<li>The system authority *EXECUTE on the library containing the subject table
|
||
|
or view,</li></ul></li>
|
||
|
<li>If the trigger being dropped is an SQL trigger:
|
||
|
<ul>
|
||
|
<li>The system authority *OBJEXIST on the trigger program object, and</li>
|
||
|
<li>The system authority *EXECUTE on the library containing the trigger.</li></ul></li></ul></li>
|
||
|
<li>Administrative authority</li></ul>
|
||
|
<p>For information on the system authorities corresponding to SQL privileges,
|
||
|
see <a href="rbafzmstgnt.htm#eqtablet">Corresponding System Authorities When Checking Privileges to a Table or View</a>.</p>
|
||
|
<a name="wq1473"></a>
|
||
|
<h3 id="wq1473"><a href="rbafzmst02.htm#ToC_1047">Syntax</a></h3>
|
||
|
<a href="rbafzmstdropst.htm#synsdrop"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
|
||
|
<a name="wq1474"></a>
|
||
|
<div class="fignone" id="wq1474">
|
||
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn333.htm"
|
||
|
border="0" /></span><a href="#skipsyn-332"><img src="c.gif" alt="Skip visual syntax diagram"
|
||
|
border="0" /></a>>>-DROP--+-ALIAS--<span class="italic">alias-name</span>---------------------------------------------------+-><
|
||
|
| .-DISTINCT-. |
|
||
|
+-+----------+--TYPE--<span class="italic">distinct-type-name</span>--+----------+----------------+
|
||
|
| +-RESTRICT-+ |
|
||
|
| '-CASCADE--' |
|
||
|
+-+-+-FUNCTION-+--<span class="italic">function-name</span>--+------------------------------+-+---+
|
||
|
| | '-ROUTINE--' '-(--+--------------------+--)-' | |
|
||
|
| | | .-,--------------. | | |
|
||
|
| | | V | | | |
|
||
|
| | '---<span class="italic">parameter-type</span>-+-' | |
|
||
|
| '-SPECIFIC--+-FUNCTION-+--<span class="italic">specific-name</span>-------------------------' |
|
||
|
| '-ROUTINE--' |
|
||
|
+-INDEX--<span class="italic">index-name</span>---------------------------------------------------+
|
||
|
+-PACKAGE--<span class="italic">package-name</span>--+-------------------------+------------------+
|
||
|
| | .-VERSION-. | |
|
||
|
| '-+---------+--<span class="italic">version-id</span>-' |
|
||
|
+-+-+-PROCEDURE-+--<span class="italic">procedure-name</span>--+------------------------------+-+-+
|
||
|
| | '-ROUTINE---' '-(--+--------------------+--)-' | |
|
||
|
| | | .-,--------------. | | |
|
||
|
| | | V | | | |
|
||
|
| | '---<span class="italic">parameter-type</span>-+-' | |
|
||
|
| '-SPECIFIC--+-PROCEDURE-+--<span class="italic">specific-name</span>--------------------------' |
|
||
|
| '-ROUTINE---' |
|
||
|
+-SCHEMA--<span class="italic">schema-name</span>--+----------+-----------------------------------+
|
||
|
| +-RESTRICT-+ |
|
||
|
| '-CASCADE--' |
|
||
|
| .-RESTRICT-. |
|
||
|
+-SEQUENCE--<span class="italic">sequence-name</span>--+----------+-------------------------------+
|
||
|
+-TABLE--<span class="italic">table-name</span>--+----------+-------------------------------------+
|
||
|
| +-RESTRICT-+ |
|
||
|
| '-CASCADE--' |
|
||
|
+-TRIGGER--<span class="italic">trigger-name</span>-----------------------------------------------+
|
||
|
'-VIEW--<span class="italic">view-name</span>--+----------+---------------------------------------'
|
||
|
+-RESTRICT-+
|
||
|
'-CASCADE--'
|
||
|
|
||
|
</pre>
|
||
|
<a name="skipsyn-332" id="skipsyn-332"></a></div>
|
||
|
<a name="wq1475"></a>
|
||
|
<div class="fignone" id="wq1475">
|
||
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn334.htm"
|
||
|
border="0" /></span><a href="#skipsyn-333"><img src="c.gif" alt="Skip visual syntax diagram"
|
||
|
border="0" /></a>parameter-type:
|
||
|
|
||
|
|----<span class="italic">data-type</span>--+------------+----------------------------------|
|
||
|
'-AS LOCATOR-'
|
||
|
|
||
|
</pre>
|
||
|
<a name="skipsyn-333" id="skipsyn-333"></a></div>
|
||
|
<a name="wq1476"></a>
|
||
|
<div class="fignone" id="wq1476">
|
||
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn335.htm"
|
||
|
border="0" /></span><a href="#skipsyn-334"><img src="c.gif" alt="Skip visual syntax diagram"
|
||
|
border="0" /></a>data-type:
|
||
|
|
||
|
|--+-<span class="italic">built-in-type</span>------+---------------------------------------|
|
||
|
'-<span class="italic">distinct-type-name</span>-'
|
||
|
|
||
|
</pre>
|
||
|
<a name="skipsyn-334" id="skipsyn-334"></a></div>
|
||
|
<a name="wq1477"></a>
|
||
|
<div class="fignone" id="wq1477">
|
||
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn336.htm"
|
||
|
border="0" /></span><a href="#skipsyn-335"><img src="c.gif" alt="Skip visual syntax diagram"
|
||
|
border="0" /></a>built-in-type:
|
||
|
|
||
|
|--+-+---SMALLINT---+----------------------------------------------------------------------------------------------+--|
|
||
|
| +-+-INTEGER-+--+ |
|
||
|
| | '-INT-----' | |
|
||
|
| '---BIGINT-----' |
|
||
|
| .-(5,0)----------------------------. |
|
||
|
+-+-+-DECIMAL-+-+--+----------------------------------+---------------------------------------------------------+
|
||
|
| | '-DEC-----' | '-(--+------------------------+--)-' |
|
||
|
| '-NUMERIC-----' '-<span class="italic">integer</span>--+-----------+-' |
|
||
|
| '-<span class="italic">, integer</span>-' |
|
||
|
| .-(53)----------. |
|
||
|
+-+-FLOAT--+---------------+-+----------------------------------------------------------------------------------+
|
||
|
| | '-(--<span class="italic">integer</span>--)-' | |
|
||
|
| +-REAL---------------------+ |
|
||
|
| | .-PRECISION-. | |
|
||
|
| '-DOUBLE--+-----------+----' |
|
||
|
| .-(1)---------------. |
|
||
|
+-+-+-+-CHARACTER-+--+-------------------+--------------+--+----------------+---------------------------------+-+
|
||
|
| | | '-CHAR------' '-(--+---------+--)-' | +-FOR BIT DATA---+ | |
|
||
|
| | | '-<span class="italic">integer</span>-' | +-FOR SBCS DATA--+ | |
|
||
|
| | '---+-+-CHARACTER-+--VARYING-+--(--+---------+--)---' +-FOR MIXED DATA-+ | |
|
||
|
| | | '-CHAR------' | '-<span class="italic">integer</span>-' '-CCSID--<span class="italic">integer</span>-' | |
|
||
|
| | '-VARCHAR----------------' | |
|
||
|
| | .-(1M)---------------------. | |
|
||
|
| '-----+-+-<span>CHARACTER</span>-+--<span>LARGE OBJECT</span>-+------+--------------------------+--+----------------+--+------------+-' |
|
||
|
| | '-<span>CHAR</span>------' | '-(--+---------+--+---+--)-' +-FOR SBCS DATA--+ '-AS LOCATOR-' |
|
||
|
| '-<span>CLOB</span>------------------------' '-<span class="italic">integer</span>-' +-K-+ +-FOR MIXED DATA-+ |
|
||
|
| +-M-+ '-CCSID--<span class="italic">integer</span>-' |
|
||
|
| '-G-' |
|
||
|
| .-(1)---------------. |
|
||
|
+-+-+---GRAPHIC----+-------------------+---------+--+----------------+-----------+------------------------------+
|
||
|
| | | '-(--+---------+--)-' | '-CCSID--<span class="italic">integer</span>-' | |
|
||
|
| | | '-<span class="italic">integer</span>-' | | |
|
||
|
| | '---+-VARGRAPHIC------+--(--+---------+--)---' | |
|
||
|
| | '-GRAPHIC VARYING-' '-<span class="italic">integer</span>-' | |
|
||
|
| | .-(1M)---------------------. | |
|
||
|
| '---DBCLOB----+--------------------------+--+----------------+--+------------+-' |
|
||
|
| '-(--+---------+--+---+--)-' '-CCSID--<span class="italic">integer</span>-' '-AS LOCATOR-' |
|
||
|
| '-<span class="italic">integer</span>-' +-K-+ |
|
||
|
| +-M-+ |
|
||
|
| '-G-' |
|
||
|
| .-(1)---------------. |
|
||
|
+-+-+-BINARY--+-------------------+---------+---------------------------------+---------------------------------+
|
||
|
| | | '-(--+---------+--)-' | | |
|
||
|
| | | '-<span class="italic">integer</span>-' | | |
|
||
|
| | '-+-BINARY VARYING-+--(--+---------+--)-' | |
|
||
|
| | '-VARBINARY------' '-<span class="italic">integer</span>-' | |
|
||
|
| | .-(1M)---------------------. | |
|
||
|
| '---+-BLOB----------------+----+--------------------------+--+------------+-' |
|
||
|
| '-BINARY LARGE OBJECT-' '-(--+---------+--+---+--)-' '-AS LOCATOR-' |
|
||
|
| '-<span class="italic">integer</span>-' +-K-+ |
|
||
|
| +-M-+ |
|
||
|
| '-G-' |
|
||
|
+-+---DATE-----------------+------------------------------------------------------------------------------------+
|
||
|
| | .-(--0--)-. | |
|
||
|
| +-TIME--+---------+------+ |
|
||
|
| | .-(--6--)-. | |
|
||
|
| '-TIMESTAMP--+---------+-' |
|
||
|
| .-(200)-------------. |
|
||
|
+---DATALINK--+-------------------+--+----------------+---------------------------------------------------------+
|
||
|
| '-(--+---------+--)-' '-CCSID--<span class="italic">integer</span>-' |
|
||
|
| '-<span class="italic">integer</span>-' |
|
||
|
'---ROWID-------------------------------------------------------------------------------------------------------'
|
||
|
|
||
|
</pre>
|
||
|
<a name="skipsyn-335" id="skipsyn-335"></a></div>
|
||
|
<a name="synsdrop"></a>
|
||
|
<h3 id="synsdrop"><a href="rbafzmst02.htm#ToC_1048">Description</a></h3>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">ALIAS <var class="pv">alias-name</var> <a id="idx2482" name="idx2482"></a><a id="idx2483" name="idx2483"></a><a id="idx2484" name="idx2484"></a></dt>
|
||
|
<dd>Identifies the alias that is to be dropped. The <span class="italic">alias-name</span> must identify an alias that exists at the current server.
|
||
|
<p>The specified alias is deleted from the schema. Dropping an alias has no effect
|
||
|
on any constraint, view, or materialized query that was defined using the
|
||
|
alias. An alias can be dropped whether or not it is referenced in a function,
|
||
|
package, procedure, program, or trigger.</p>
|
||
|
</dd>
|
||
|
<dt class="bold">DISTINCT TYPE <var class="pv">distinct-type-name</var> </dt><a id="idx2485" name="idx2485"></a><a id="idx2486" name="idx2486"></a>
|
||
|
<dd>Identifies the distinct type that is to be dropped. The <span class="italic">distinct-type-name</span> must
|
||
|
identify a distinct type that exists at the current server. The specified type is
|
||
|
deleted from the schema.
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">Neither CASCADE nor RESTRICT</dt>
|
||
|
<dd>Specifies that the type cannot be dropped if any constraints, indexes,
|
||
|
sequences, tables, and views reference the type.
|
||
|
<p>For every procedure or
|
||
|
function <tt class="xph">R</tt> that has parameters or a return value of the type being
|
||
|
dropped, or a reference to the type being dropped, the following DROP statement
|
||
|
is effectively executed:</p>
|
||
|
<pre class="xmp"> <span class="bold">DROP ROUTINE</span> R</pre>
|
||
|
<p>For every trigger <tt class="xph">T</tt> that references the type being dropped, the
|
||
|
following DROP statement is effectively executed:</p>
|
||
|
<pre class="xmp"> <span class="bold">DROP TRIGGER</span> T</pre>
|
||
|
<p>It is possible that this statement would cascade
|
||
|
to drop dependent functions or procedures. If all of these functions or procedures
|
||
|
are in the list to be dropped because of a dependency on the distinct type, the drop
|
||
|
of the distinct type will succeed.</p>
|
||
|
</dd>
|
||
|
<dt class="bold">CASCADE </dt><a id="idx2487" name="idx2487"></a>
|
||
|
<dd>Specifies that the type will be dropped even if it is referenced in
|
||
|
a constraint, function, index, procedure, sequence, table, trigger, or view.
|
||
|
All constraints, functions, indexes, procedures, sequences, tables, triggers,
|
||
|
and views that reference the type are dropped.
|
||
|
</dd>
|
||
|
<dt class="bold">RESTRICT </dt><a id="idx2488" name="idx2488"></a><a id="idx2489" name="idx2489"></a>
|
||
|
<dd>Specifies that the type cannot be dropped if it is referenced in a constraint,
|
||
|
function (other than a function that was created when the type was created),
|
||
|
index, procedure, sequence, table, trigger, or view.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">FUNCTION or SPECIFIC FUNCTION</dt><a id="idx2490" name="idx2490"></a><a id="idx2491" name="idx2491"></a>
|
||
|
<dd>Identifies the function that is to be dropped. The function must exist
|
||
|
at the current server and it must be a function that was defined with the
|
||
|
CREATE FUNCTION statement. The particular function can be identified by its
|
||
|
name, function signature, or specific name.
|
||
|
<p>Functions implicitly generated
|
||
|
by the CREATE DISTINCT TYPE statement cannot be dropped using the DROP statement.
|
||
|
They are implicitly dropped when the distinct type is dropped.</p>
|
||
|
<p>The function
|
||
|
cannot be dropped if another function is dependent on it. A function is dependent
|
||
|
on another function if it was identified in the SOURCE clause of the CREATE
|
||
|
FUNCTION statement. A function can be dropped whether or not it is referenced
|
||
|
in a function, package, procedure, program, trigger, or view.</p>
|
||
|
<p>The specified
|
||
|
function is dropped from the schema. All privileges on the user-defined function
|
||
|
are also dropped. If this is an SQL function or sourced function, the service
|
||
|
program (*SRVPGM) associated with the function is also dropped. If this is
|
||
|
an external function, the information that was saved in the program or service
|
||
|
program specified on the CREATE FUNCTION statement is removed from the object.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">FUNCTION <var class="pv">function-name</var> </dt>
|
||
|
<dd>Identifies the function by its name. The <span class="italic">function-name</span> must identify exactly one function. The function may have any number
|
||
|
of parameters defined for it. If there is more than one function of the specified
|
||
|
name in the specified or implicit schema, an error is returned.
|
||
|
</dd>
|
||
|
<dt class="bold">FUNCTION <var class="pv">function-name (parameter-type, ...)</var></dt>
|
||
|
<dd>Identifies the function by its function signature, which uniquely identifies
|
||
|
the function. The <span class="italic">function-name (parameter-type, ...)</span> must identify a function with the specified function signature. The
|
||
|
specified parameters must match the data types in the corresponding position
|
||
|
that were specified when the function was created. The number of data types,
|
||
|
and the logical concatenation of the data types is used to identify the specific
|
||
|
function instance which is to be dropped. Synonyms for data types are considered
|
||
|
a match.
|
||
|
<p>If <var class="pv">function-name ()</var> is specified, the function identified
|
||
|
must have zero parameters.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold"><var class="pv">function-name </var></dt>
|
||
|
<dd>Identifies the name of the function.
|
||
|
</dd>
|
||
|
<dt class="bold"><var class="pv">(parameter-type, ...)</var></dt>
|
||
|
<dd>Identifies the parameters of the function.
|
||
|
<p>If an unqualified distinct
|
||
|
type name is specified, the database manager searches the SQL path to resolve the schema
|
||
|
name for the distinct type.</p>
|
||
|
<p>For data types that have a length, precision,
|
||
|
or scale attribute, use one of the following:</p>
|
||
|
<ul>
|
||
|
<li>Empty parentheses indicate that the database manager ignores the attribute when determining
|
||
|
whether the data types match. For example, DEC() will be considered a match
|
||
|
for a parameter of a function defined with a data type of DEC(7,2). However,
|
||
|
FLOAT cannot be specified with empty parenthesis because its parameter value
|
||
|
indicates a specific data type (REAL or DOUBLE).</li>
|
||
|
<li>If a specific value for a length, precision, or scale attribute is specified,
|
||
|
the value must exactly match the value that was specified (implicitly or explicitly)
|
||
|
in the CREATE FUNCTION statement. If the data type is FLOAT, the precision
|
||
|
does not have to exactly match the value that was specified because matching
|
||
|
is based on the data type (REAL or DOUBLE).</li>
|
||
|
<li>If length, precision, or scale is not explicitly specified, and empty
|
||
|
parentheses are not specified, the default attributes of the data type are
|
||
|
implied. The implicit length must exactly match the value that was specified
|
||
|
(implicitly or explicitly) in the CREATE FUNCTION statement.</li></ul>
|
||
|
<p>Specifying the FOR DATA clause or CCSID clause is optional. Omission
|
||
|
of either clause indicates that the database manager ignores the attribute when determining
|
||
|
whether the data types match. If either clause is specified, it must match
|
||
|
the value that was implicitly or explicitly specified in the CREATE FUNCTION
|
||
|
statement.</p>
|
||
|
</dd>
|
||
|
<dt class="bold">AS LOCATOR</dt>
|
||
|
<dd>Specifies that the function is defined to receive a locator for this
|
||
|
parameter. If AS LOCATOR is specified, the data type must be a LOB or a distinct
|
||
|
type based on a LOB.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">SPECIFIC FUNCTION <var class="pv">specific-name</var> <a id="idx2492" name="idx2492"></a></dt><a id="idx2493" name="idx2493"></a><a id="idx2494" name="idx2494"></a>
|
||
|
<dd>Identifies the function by its specific name. The <span class="italic">specific-name</span> must identify a specific function that exists at the current
|
||
|
server.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">INDEX <var class="pv">index-name</var> </dt><a id="idx2495" name="idx2495"></a><a id="idx2496" name="idx2496"></a><a id="idx2497" name="idx2497"></a>
|
||
|
<dd>Identifies the index that is to be dropped. The <span class="italic">index-name</span> must identify an index that exists at the current server.
|
||
|
<p>The specified index is dropped from the schema. An index can be dropped whether
|
||
|
or not it is referenced in a function, package, procedure, program, or trigger.</p>
|
||
|
</dd>
|
||
|
<dt class="bold">PACKAGE <var class="pv">package-name</var> </dt><a id="idx2498" name="idx2498"></a><a id="idx2499" name="idx2499"></a><a id="idx2500" name="idx2500"></a>
|
||
|
<dd>Identifies the package that is to be dropped. The <span class="italic">package-name</span> must identify a package that exists at the current server.
|
||
|
<p>The specified package is dropped from the schema. All privileges on the package
|
||
|
are also dropped.</p>
|
||
|
<p>A package can be dropped whether or not it is referenced
|
||
|
in a function, package, procedure, program, or trigger.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">VERSION <var class="pv">version-id</var></dt>
|
||
|
<dd><var class="pv">version-id</var> is the version identifier that was assigned to the
|
||
|
package when it was created. If <var class="pv">version-id</var> is not specified, a null
|
||
|
string is used as the version identifier.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">PROCEDURE or SPECIFIC PROCEDURE</dt><a id="idx2501" name="idx2501"></a><a id="idx2502" name="idx2502"></a>
|
||
|
<dd>Identifies the procedure that is to be dropped. The <span class="italic">procedure-name</span> must identify a procedure that exists at the current server.
|
||
|
<p>The specified procedure is dropped from the schema. All privileges on the
|
||
|
procedure are also dropped. If this is an SQL procedure, the program (*PGM)
|
||
|
associated with the procedure is also dropped. If this is an external procedure,
|
||
|
the information that was saved in the program specified on the CREATE PROCEDURE
|
||
|
statement is removed from the object.</p>
|
||
|
<p>A procedure can be dropped whether
|
||
|
or not it is referenced in a function, package, procedure, program, trigger,
|
||
|
or view.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">PROCEDURE <var class="pv">procedure-name</var> </dt>
|
||
|
<dd>Identifies the procedure by its name. The <span class="italic">procedure-name</span> must identify exactly one procedure. The procedure may have any number
|
||
|
of parameters defined for it. If there is more than one procedure of the specified
|
||
|
name in the specified or implicit schema, an error is returned.
|
||
|
</dd>
|
||
|
<dt class="bold">PROCEDURE <var class="pv">procedure-name (parameter-type, ...)</var></dt>
|
||
|
<dd>Identifies the procedure by its procedure signature, which uniquely
|
||
|
identifies the procedure. The <span class="italic">procedure-name (parameter-type,
|
||
|
...)</span> must identify a procedure with the specified procedure signature.
|
||
|
The specified parameters must match the data types in the corresponding position
|
||
|
that were specified when the procedure was created. The number of data types,
|
||
|
and the logical concatenation of the data types is used to identify the specific
|
||
|
procedure instance which is to be dropped. Synonyms for data types are considered
|
||
|
a match.
|
||
|
<p>If <var class="pv">procedure-name ()</var> is specified, the procedure identified
|
||
|
must have zero parameters.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold"><var class="pv">procedure-name </var></dt>
|
||
|
<dd>Identifies the name of the procedure.
|
||
|
</dd>
|
||
|
<dt class="bold"><var class="pv">(parameter-type, ...)</var></dt>
|
||
|
<dd>Identifies the parameters of the procedure.
|
||
|
<p>If an unqualified distinct
|
||
|
type name is specified, the database manager searches the SQL path to resolve the schema
|
||
|
name for the distinct type.</p>
|
||
|
<p>For data types that have a length, precision,
|
||
|
or scale attribute, use one of the following:</p>
|
||
|
<ul>
|
||
|
<li>Empty parentheses indicate that the database manager ignores the attribute when determining
|
||
|
whether the data types match. For example, DEC() will be considered a match
|
||
|
for a parameter of a procedure defined with a data type of DEC(7,2). However,
|
||
|
FLOAT cannot be specified with empty parenthesis because its parameter value
|
||
|
indicates a specific data type (REAL or DOUBLE).</li>
|
||
|
<li>If a specific value for a length, precision, or scale attribute is specified,
|
||
|
the value must exactly match the value that was specified (implicitly or explicitly)
|
||
|
in the CREATE PROCEDURE statement. If the data type is FLOAT, the precision
|
||
|
does not have to exactly match the value that was specified because matching
|
||
|
is based on the data type (REAL or DOUBLE).</li>
|
||
|
<li>If length, precision, or scale is not explicitly specified, and empty
|
||
|
parentheses are not specified, the default attributes of the data type are
|
||
|
implied. The implicit length must exactly match the value that was specified
|
||
|
(implicitly or explicitly) in the CREATE PROCEDURE statement.</li></ul>
|
||
|
<p>Specifying the FOR DATA clause or CCSID clause is optional. Omission
|
||
|
of either clause indicates that the database manager ignores the attribute when determining
|
||
|
whether the data types match. If either clause is specified, it must match
|
||
|
the value that was implicitly or explicitly specified in the CREATE PROCEDURE
|
||
|
statement.</p>
|
||
|
</dd>
|
||
|
<dt class="bold">AS LOCATOR</dt>
|
||
|
<dd>Specifies that the procedure is defined to receive a locator for this
|
||
|
parameter. If AS LOCATOR is specified, the data type must be a LOB or a distinct
|
||
|
type based on a LOB.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">SPECIFIC PROCEDURE <var class="pv">specific-name</var> </dt><a id="idx2503" name="idx2503"></a><a id="idx2504" name="idx2504"></a><a id="idx2505" name="idx2505"></a>
|
||
|
<dd>Identifies the procedure by its specific name. The <span class="italic">specific-name</span> must identify a specific procedure that exists at the current
|
||
|
server.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">SCHEMA <var class="pv">schema-name</var> </dt><a id="idx2506" name="idx2506"></a><a id="idx2507" name="idx2507"></a><a id="idx2508" name="idx2508"></a><a id="idx2509" name="idx2509"></a><a id="idx2510" name="idx2510"></a>
|
||
|
<dd>Identifies the schema that is to be dropped. The <span class="italic">schema-name</span> must identify a schema that exists at the current server.
|
||
|
<p>The specified schema is dropped. Each object in the schema is dropped as if
|
||
|
the appropriate DROP statement was executed with the specified drop option
|
||
|
(CASCADE, RESTRICT, or neither). See the DROP description of these object
|
||
|
types for information on the handling of objects dependent on these objects.</p>
|
||
|
<p>DROP SCHEMA is only valid when the commit level is *NONE.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">Neither CASCADE nor RESTRICT</dt>
|
||
|
<dd>Specifies that the schema will be dropped even if it is referenced in
|
||
|
a function, package, procedure, program, table, or trigger in another schema.
|
||
|
</dd>
|
||
|
<dt class="bold">CASCADE </dt><a id="idx2511" name="idx2511"></a>
|
||
|
<dd>Specifies that any objects in the schema and any triggers that reference
|
||
|
the schema will be dropped.
|
||
|
</dd>
|
||
|
<dt class="bold">RESTRICT </dt><a id="idx2512" name="idx2512"></a><a id="idx2513" name="idx2513"></a>
|
||
|
<dd>Specifies that the schema cannot be dropped if it is referenced in an
|
||
|
SQL trigger in another schema or if the schema contains any SQL objects other
|
||
|
than catalog views, the journal, and journal receiver.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">SEQUENCE <var class="pv">sequence-name</var> </dt><a id="idx2514" name="idx2514"></a><a id="idx2515" name="idx2515"></a>
|
||
|
<dd>Identifies the sequence that is to be dropped. The <span class="italic">sequence-name</span> must identify a sequence that exists at the current server.
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">RESTRICT </dt><a id="idx2516" name="idx2516"></a><a id="idx2517" name="idx2517"></a>
|
||
|
<dd>Specifies that the sequence cannot be dropped if it is referenced in
|
||
|
an SQL trigger, function, or procedure.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">TABLE <var class="pv">table-name</var> </dt><a id="idx2518" name="idx2518"></a><a id="idx2519" name="idx2519"></a>
|
||
|
<dd>Identifies the table that is to be dropped. The <span class="italic">table-name</span> must identify a base table that exists at the current server,
|
||
|
but must not identify a catalog table.
|
||
|
<p>The specified table is dropped from
|
||
|
the schema. All privileges, constraints, indexes, and triggers on the table
|
||
|
are also dropped.</p>
|
||
|
<p>Any aliases that reference the specified table are
|
||
|
not dropped.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">Neither CASCADE nor RESTRICT</dt>
|
||
|
<dd>Specifies that the table will be dropped even if it is referenced
|
||
|
in a constraint, index, trigger, view, or materialized query table. All indexes,
|
||
|
views, and materialized query tables that reference the table are dropped
|
||
|
even if the authorization ID of the statement does not explicitly have privileges
|
||
|
to those objects.
|
||
|
</dd>
|
||
|
<dt class="bold">CASCADE </dt><a id="idx2520" name="idx2520"></a>
|
||
|
<dd>Specifies that the table will be dropped even if it is referenced
|
||
|
in a constraint, index, trigger, view, or materialized query table. All constraints,
|
||
|
indexes, triggers, views, and materialized query tables that reference the
|
||
|
table are dropped even if the authorization ID of the statement does not explicitly
|
||
|
have privileges to those objects.
|
||
|
</dd>
|
||
|
<dt class="bold">RESTRICT </dt><a id="idx2521" name="idx2521"></a><a id="idx2522" name="idx2522"></a>
|
||
|
<dd>Specifies that the table cannot be dropped if it is referenced in a
|
||
|
constraint, index, trigger, view, or materialized query table.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
<dt class="bold">TRIGGER <var class="pv">trigger-name</var> </dt><a id="idx2523" name="idx2523"></a><a id="idx2524" name="idx2524"></a><a id="idx2525" name="idx2525"></a>
|
||
|
<dd>Identifies the trigger that is to be dropped. The <span class="italic">trigger-name</span> must identify a trigger that exists at the current server.
|
||
|
<p>The specified trigger is dropped from the schema. If the trigger is an SQL
|
||
|
trigger, the program object associated with the trigger is also deleted from
|
||
|
the schema.</p>
|
||
|
<p>If <span class="italic">trigger-name</span> specifies
|
||
|
an INSTEAD OF trigger on a view, another trigger may depend on that trigger
|
||
|
through an update against the view.</p>
|
||
|
</dd>
|
||
|
<dt class="bold">VIEW <var class="pv">view-name</var> </dt><a id="idx2526" name="idx2526"></a><a id="idx2527" name="idx2527"></a><a id="idx2528" name="idx2528"></a>
|
||
|
<dd>Identifies the view that is to be dropped. The <span class="italic">view-name</span> must identify a view that exists at the current server, but must not
|
||
|
identify a catalog view.
|
||
|
<p>The specified view is dropped from
|
||
|
the schema. When a view is dropped, all privileges and triggers on that view
|
||
|
are dropped.</p>
|
||
|
<dl class="parml">
|
||
|
<dt class="bold">Neither CASCADE nor RESTRICT</dt>
|
||
|
<dd>Specifies that the view will be dropped even if it is referenced in
|
||
|
a trigger, materialized query table, or another view. All views and materialized
|
||
|
query tables that reference the view are dropped.
|
||
|
</dd>
|
||
|
<dt class="bold">CASCADE </dt><a id="idx2529" name="idx2529"></a>
|
||
|
<dd>Specifies that the view will be dropped even if it is referenced in
|
||
|
a trigger, materialized query table, or another view. All triggers, materialized
|
||
|
query tables, and views that reference the view are dropped.
|
||
|
</dd>
|
||
|
<dt class="bold">RESTRICT </dt><a id="idx2530" name="idx2530"></a>
|
||
|
<dd>Specifies that the view cannot be dropped if it is referenced in a trigger,
|
||
|
materialized query table, or another view.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<a name="wq1478"></a>
|
||
|
<h3 id="wq1478"><a href="rbafzmst02.htm#ToC_1049">Note</a></h3>
|
||
|
<p><span class="bold">Drop effects:</span> Whenever an object is dropped, its
|
||
|
description is dropped from the catalog. If the object is referenced in a
|
||
|
function, package, procedure, program, or trigger; any access plans that reference
|
||
|
the object are implicitly prepared again when the access plan is next used.
|
||
|
If the object does not exist at that time, an error is returned.</p>
|
||
|
<p><span class="bold">Syntax alternatives:</span> The following keywords are synonyms
|
||
|
supported for compatibility to prior releases. These keywords are non-standard
|
||
|
and should not be used:</p>
|
||
|
<ul>
|
||
|
<li>The keyword SYNONYM can be used as a synonym for ALIAS.</li>
|
||
|
<li>The keyword DATA can be used as a synonym for DISTINCT.</li>
|
||
|
<li>The keyword PROGRAM can be used as a synonym for PACKAGE.</li>
|
||
|
<li>The keyword COLLECTION can be used as a synonym for SCHEMA.</li></ul>
|
||
|
<a name="wq1479"></a>
|
||
|
<h3 id="wq1479"><a href="rbafzmst02.htm#ToC_1050">Examples</a></h3>
|
||
|
<p><span class="italic">Example 1:</span> Drop your table named MY_IN_TRAY.
|
||
|
Do not allow the drop if any views or indexes are created over this table. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP TABLE</span> MY_IN_TRAY <span class="bold">RESTRICT</span></pre>
|
||
|
<p><span class="italic">Example 2:</span> Drop your view named MA_PROJ. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP VIEW</span> MA_PROJ</pre>
|
||
|
<p><span class="italic">Example 3:</span> Drop the package named PERS.PACKA. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP PACKAGE</span> PERS.PACKA</pre>
|
||
|
<p><span class="italic">Example 4:</span> Drop the distinct type DOCUMENT, if
|
||
|
it is not currently in use: </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP DISTINCT TYPE</span> DOCUMENT <span class="bold">RESTRICT</span></pre>
|
||
|
<p><span class="italic">Example 5:</span> Assume that you are SMITH and that ATOMIC_WEIGHT
|
||
|
is the only function with that name in schema CHEM. Drop ATOMIC_WEIGHT. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP FUNCTION</span> CHEM.ATOMIC_WEIGHT <span class="bold">RESTRICT</span></pre>
|
||
|
<p><span class="italic">Example 6:</span> Drop CENTER, using the function signature
|
||
|
to identify the function instance to be dropped. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP FUNCTION</span> CENTER <span class="bold">(INTEGER, FLOAT) RESTRICT</span></pre>
|
||
|
<p><span class="italic">Example 7:</span> Assume that you are SMITH and that you
|
||
|
created another function named CENTER, which you gave the specific name FOCUS97,
|
||
|
in schema JOHNSON. Drop CENTER, using the specific name to identify the function
|
||
|
instance to be dropped. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP SPECIFIC FUNCTION</span> JOHNSON.FOCUS97</pre>
|
||
|
<p><span class="italic">Example 8:</span> Assume that you are SMITH and that stored
|
||
|
procedure OSMOSIS is in schema BIOLOGY. Drop OSMOSIS. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP PROCEDURE</span> BIOLOGY.OSMOSIS</pre>
|
||
|
<p><span class="italic">Example 9:</span> Assume that you are SMITH and that trigger
|
||
|
BONUS is in your schema. Drop BONUS. </p>
|
||
|
<pre class="xmp"> <span class="bold">DROP TRIGGER</span> BONUS</pre>
|
||
|
<p><a id="idx2531" name="idx2531"></a><a id="idx2532" name="idx2532"></a><a id="idx2533" name="idx2533"></a><a id="idx2534" name="idx2534"></a></p>
|
||
|
<hr /><br />
|
||
|
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstdiscon.htm">Previous Page</a> | <a href="rbafzmsteds.htm">Next Page</a> | <a href="rbafzmst02.htm#wq1">Contents</a> |
|
||
|
<a href="rbafzmstindex.htm#index">Index</a> ]
|
||
|
|
||
|
<a id="Bot_Of_Page" name="Bot_Of_Page"></a>
|
||
|
</body>
|
||
|
</html>
|