我的Oracle 11.2.0.2.0和通过下面的脚本创建唯一约束的表:Oracle alter table drop constraint索引语法上有效吗?
create table foo (id varchar(26) not null, name varchar(50) not null);
alter table foo add constraint pk_foo primary key (id);
/**/
alter table foo add constraint un_foo unique (name);
我需要删除唯一约束,这是很容易:
alter table foo drop constraint un_foo;
麻烦的是:
:当数据库中的SQL开发者被备份,然后还原,则un_foo
唯一索引由
明确命令放置在
/**/
线创建
这样一个显式创建的索引不会被上面的alter命令删除。我意识到下面的命令作品:
alter table foo drop constraint un_foo drop index;
对于主键,类似命令处于documentation或Oracle Developer Community discussion。此外,this answer at AskTom也使用此语法(对于keep index
)。然而我在alter table
命令的铁路图中没有看到这种语法的推理。
问题:语法是alter table foo drop constraint un_foo drop index
合法吗?如果是这样,根据什么文件或流量在铁路图中?如果没有,为什么命令不会失败?
谢谢!