下拉表

下拉表 — remove a table

句法

DROP TABLE
    [IF EXISTS] [CASCADE | RESTRICT] [schema.]table_name
DROP TABLE
    [schema.]table_name [IF EXISTS] [CASCADE | RESTRICT]

描述

Use the 下拉表 statement to remove the table and all its data.
Only its owner may remove a table. A table may be emptied of rows, but not removed, by using 删除. You can also use 截短. (See 删除, 截短。)
下拉表 始终删除目标表中存在的任何索引,触发器和约束。
IF EXISTS, CASCADE and RESTRICT can occur before or after table_name, but not both.

From the release of NuoDB 3.4, the CASCADE option is deprecated. The optional CASCADE parameter no longer drops all tables in a table hierarchy list. Nor does it drop all tables containing foreign keys pointing to the dropped table. For more information on features deprecated in this release, see 已弃用功能.

参数

schema

可选的。拥有要删除表的模式的名称。如果未提供架构,则表必须由当前架构拥有。

table_name

现有表的名称(可选地模式限定)删除。

IF EXISTS

If the table does not exist and you specify IF EXISTS, NuoDB does not generate an error. If not specified and the table does not exist, an error is generated.

CASCADE

The CASCADE keyword is provided only for syntax compatibility and is ignored by NuoDB.

RESTRICT

The RESTRICT keyword is provided only for syntax compatibility and is ignored by NuoDB.

==示例

用 HOCKEY
DROP TABLE hockey_fan;
 can't find table "HOCKEY_FAN"
DROP TABLE IF EXISTS hockey_fan;

CREATE TABLE hockey_fan (id     INTEGER GENERATED ALWAYS AS IDENTITY,
                         name   STRING );

DROP TABLE hockey_fan;