drop_table.sgml
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:4k
源码类别:

数据库系统

开发平台:

Unix_Linux

  1. <refentry id="SQL-DROPTABLE">
  2.  <refmeta>
  3.   <refentrytitle>
  4.    DROP TABLE
  5.   </refentrytitle>
  6.   <refmiscinfo>SQL - Language Statements</refmiscinfo>
  7.  </refmeta>
  8.  <refnamediv>
  9.   <refname>
  10.    DROP TABLE
  11.   </refname>
  12.   <refpurpose>
  13.    Removes existing tables from a database
  14.   </refpurpose>
  15.  </refnamediv>
  16.  <refsynopsisdiv>
  17.   <refsynopsisdivinfo>
  18.    <date>1998-09-22</date>
  19.   </refsynopsisdivinfo>
  20.   <synopsis>
  21. DROP TABLE <replaceable class="PARAMETER">name</replaceable> [, ...]
  22.   </synopsis>
  23.   
  24.   <refsect2 id="R2-SQL-DROPTABLE-1">
  25.    <refsect2info>
  26.     <date>1998-09-22</date>
  27.    </refsect2info>
  28.    <title>
  29.     Inputs
  30.    </title>
  31.    <para>
  32.     <variablelist>
  33.      <varlistentry>
  34.       <term><replaceable class="PARAMETER">name</replaceable></term>
  35.       <listitem>
  36.        <para>
  37. The name of an existing table or view to drop.
  38.        </para>
  39.       </listitem>
  40.      </varlistentry>
  41.     </variablelist>
  42.    </para>
  43.   </refsect2>
  44.   <refsect2 id="R2-SQL-DROPTABLE-2">
  45.    <refsect2info>
  46.     <date>1998-09-22</date>
  47.    </refsect2info>
  48.    <title>
  49.     Outputs
  50.    </title>
  51.    <para>
  52.     <variablelist>
  53.      <varlistentry>
  54.       <term><computeroutput>
  55. DROP
  56.        </computeroutput></term>
  57.       <listitem>
  58.        <para>
  59. The message returned if the command completes successfully.
  60.        </para>
  61.       </listitem>
  62.      </varlistentry>
  63.      <varlistentry>
  64.       <term><computeroutput>
  65. ERROR Relation "<replaceable class="parameter">name</replaceable>" Does Not Exist!
  66.        </computeroutput></term>
  67.       <listitem>
  68.        <para>
  69. If the specified table or view does not exist in the database.
  70.        </para>
  71.       </listitem>
  72.      </varlistentry>
  73.     </variablelist>
  74.    </para>
  75.   </refsect2>
  76.  </refsynopsisdiv>
  77.  
  78.  <refsect1 id="R1-SQL-DROPTABLE-1">
  79.   <refsect1info>
  80.    <date>1998-09-22</date>
  81.   </refsect1info>
  82.   <title>
  83.    Description
  84.   </title>
  85.   <para>
  86.    <command>DROP TABLE</command> removes tables and views from the database.
  87.    Only its owner may destroy a table or view. A table
  88.    may be emptied of rows, but not destroyed, by using <command>DELETE</command>.
  89.   </para>
  90.   <para>
  91.    If a table being destroyed has secondary indexes on it,
  92.    they will be removed first. The removal of just a
  93.    secondary index will not affect the contents of the underlying table.
  94.   </para>
  95.   <refsect2 id="R2-SQL-DROPTABLE-3">
  96.    <refsect2info>
  97.     <date>1998-09-22</date>
  98.    </refsect2info>
  99.    <title>
  100.     Notes
  101.    </title>
  102.    <para>
  103.     Refer to <command>CREATE TABLE</command> and
  104.     <command>ALTER TABLE</command> for information on
  105.     how to create or modify tables.
  106.    </para>
  107.   </refsect2>
  108.  </refsect1>
  109.  <refsect1 id="R1-SQL-DROPTABLE-2">
  110.   <title>
  111.    Usage
  112.   </title>
  113.   <para>
  114.    To destroy two tables, <literal>films</literal> and 
  115.    <command>distributors</command>:
  116.    <programlisting>
  117. DROP TABLE films, distributors;
  118.    </programlisting>
  119.   </para>
  120.  </refsect1>
  121.  
  122.  <refsect1 id="R1-SQL-DROPTABLE-3">
  123.    <title>
  124.    Compatibility
  125.   </title>
  126.   <para>
  127.   </para>
  128.   
  129.   <refsect2 id="R2-SQL-DROPTABLE-4">
  130.    <refsect2info>
  131.     <date>1998-09-22</date>
  132.    </refsect2info>
  133.    <title>
  134.     SQL92
  135.    </title>
  136.    <para>
  137.     SQL92 specifies some additional capabilities for DROP TABLE:
  138.    </para>
  139.    <synopsis>
  140. DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE }
  141.    </synopsis>
  142.    <variablelist>
  143.     <varlistentry>
  144.      <term>RESTRICT</term>
  145.      <listitem>
  146.       <para>
  147.        Ensures that only a table with no dependent views or
  148.        integrity constraints can be destroyed.
  149.       </para>
  150.      </listitem>
  151.     </varlistentry>
  152.     <varlistentry>
  153.      <term>CASCADE</term>
  154.      <listitem>
  155.       <para>
  156.        Any referencing views or integrity constraints
  157.        will also be dropped.
  158.       </para>
  159.      </listitem>
  160.     </varlistentry>
  161.    </variablelist>
  162.     <tip>
  163.     <para>
  164.      At present, to remove a referenced view you must drop
  165.      it explicitly.
  166.     </para>
  167.    </tip>
  168.    </refsect2>
  169.  </refsect1>
  170. </refentry>
  171. <!-- Keep this comment at the end of the file
  172. Local variables:
  173. mode: sgml
  174. sgml-omittag:nil
  175. sgml-shorttag:t
  176. sgml-minimize-attributes:nil
  177. sgml-always-quote-attributes:t
  178. sgml-indent-step:1
  179. sgml-indent-data:t
  180. sgml-parent-document:nil
  181. sgml-default-dtd-file:"../reference.ced"
  182. sgml-exposed-tags:nil
  183. sgml-local-catalogs:"/usr/lib/sgml/catalog"
  184. sgml-local-ecat-files:nil
  185. End:
  186. -->