Oracle 约束的相关操作

 
15.
	alter table mytable add primary key(col[,df[,..]])
	alter table mytable add constraint constraint_name primary key(col)
	alter table mytable disable primary key
	alter table mytable constraint 原主键名 to 新
16.alter table t1 add constraint fk_t1_t2 foreign key (cid) references t2(cid);
17.alter table emp add constraint fk_a foreign (empno) references dept(deptno) on delete cascade
18 alter table emp rename constraint fk1 to fk2
19.alter table tablea disabled constraint fk_1;
20.--关闭数据完整性交验
  alter table purchase enable novalidate constraint fk
21.alter table tableA drop constraint my_pk 删除约束
22.alter table add constraint name unique(col1,col2);
23.alter table mytable add constraint cons_name check(col<col1)
34.alter table mytable modify st default 'AC';\
35 alter table mytable modify(col1 not null)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值