ORACLE ALTER CONSTRAINT
来源:互联网 发布:zookeeper和nginx 编辑:程序博客网 时间:2024/05/22 05:33
--第一步:增加列key_no
alter table TB_ZHAOZHENLONG add key_no int;
--第二部:给key_no更新值
update TB_ZHAOZHENLONG set key_no =rownum;
commit;
--第三步:将key_no置为非空
alter table TB_ZHAOZHENLONG modify key_no int not null;
--第四步:查找主键
select constraint_name from user_constraints where constraint_type='P' and owner=user and table_name='TB_ZHAOZHENLONG' ;
--第五步:删除主键
ALTER TABLE TB_ZHAOZHENLONG DROP CONSTRAINT PK_TB_ZHAOZHENLONG;
--第六步:增加主键
ALTER TABLE TB_ZHAOZHENLONG ADD (CONSTRAINT PK_TB_ZHAOZHENLONG PRIMARY KEY(c_1,c_2,c_3);
alter table TB_ZHAOZHENLONG add key_no int;
--第二部:给key_no更新值
update TB_ZHAOZHENLONG set key_no =rownum;
commit;
--第三步:将key_no置为非空
alter table TB_ZHAOZHENLONG modify key_no int not null;
--第四步:查找主键
select constraint_name from user_constraints where constraint_type='P' and owner=user and table_name='TB_ZHAOZHENLONG' ;
--第五步:删除主键
ALTER TABLE TB_ZHAOZHENLONG DROP CONSTRAINT PK_TB_ZHAOZHENLONG;
--第六步:增加主键
ALTER TABLE TB_ZHAOZHENLONG ADD (CONSTRAINT PK_TB_ZHAOZHENLONG PRIMARY KEY(c_1,c_2,c_3);
- ORACLE ALTER CONSTRAINT
- alter table *** add constraint
- db2 alter 以及 db2 constraint
- alter table *** add constraint *** 用法
- alter table *** add constraint *** 用法
- alter table *** add constraint *** 用法
- Oracle Constraint
- Oracle Constraint
- oracle Constraint
- Oracle ALTER
- oracle alter
- Constraint of Oracle studing
- oracle 建表 约束 constraint
- Oracle constraint type
- Oracle Constraint 约束
- constraint - Oracle Documentation
- oracle约束讲解constraint
- oracle Constraint(一)
- java文件工具操作类(自己用的哦)
- 做员工的心得
- Oracle Apps Concurrent Manager
- Android中多层动态嵌套布局的实现
- Android WindowManager$BadTokenException tab嵌套,activitygroup等
- ORACLE ALTER CONSTRAINT
- 使用 PHP 直接在共享内存中存储数据集
- C++开源库介绍
- Windows Server 2012 搭建PHP+MySQL环境安装DedeCMS系统
- Android TextView换行问题
- java 对象的强、软、弱和虚引用的概念
- 通过资源的名称,得到保存在R中的ID
- 数据结构常用算法
- 两个SQl数据库中的表相互复制