Oracle删除唯一约束

一 语法

DISABLE|ENABLE CONSTRAINT constraint_name

二 代码
  1. SQL>select constraint_name,constraint_type,status from user_constraints
  2. 2where table_name ='USERINFO_U2';
  3. CONSTRAINT_NAME C STATUS
  4. ---------------------------------------
  5. SYS_C0011117 P ENABLED
  6. UN_USERNAME_NEW U ENABLED
  7. SQL> alter table userinfo_u2
  8. 2 disable constraint UN_USERNAME_NEW;
  9. 表已更改。
  10. SQL>select constraint_name,constraint_type,status from user_constraints
  11. 2where table_name ='USERINFO_U2';
  12. CONSTRAINT_NAME C STATUS
  13. ---------------------------------------
  14. SYS_C0011117 P ENABLED
  15. UN_USERNAME_NEW U DISABLED
三 语法
DROP CONSTRAINT constraint_name
四 代码
  1. SQL> alter table userinfo_u2
  2. 2 drop constraint UN_USERNAME_NEW;
  3. 表已更改。

猜你喜欢

转载自cakin24.iteye.com/blog/2389129