amberoracle 2011-04-07
1.删除约束
alter table table_name drop constraint constraint_name;
2.创建主键
alter table table_name add constraint constraint_name primary key(column_name1,column_name2);
3.创建唯一约束
alter table table_name add constraint constraint_name unique(column_name1,column_name2);
4.创建外键约束
alter table table_name1 add constraint constraint_name foreign key(column_name1) references table_name2(column_name1);
enable/disable:约束/不约束新数据
novalidate/validate:不对/对老数据进行验证
alter table table_name add constraint constraint_name check(column_name like 'B%') enable/disable novalidate/validate;
5.修改约束条件,延时验证,commit时验证
alter table table_name modify constraint constraint_name initially deferred;
6.修改约束条件,立即验证
alter table table_name modify constraint constraint_name initially immediate;
7.设置约束延迟/立即验证
alter session set constraints=deferred/immediate;
8.删除表时删除约束
drop一个有外键的主键表,带cascade constraints参数级联删除
drop table table_name cascade constraints;
9.当truncate外键表时,先将外键设为无效,再truncate;
truncate table table_name;
设约束条件无效
alter table table_name disable constraint constraint_name;
alter table table_name enable novalidate constraint constraint_name;
表格的现在还是较为常用的一种标签,但不是用来布局,常见处理、显示表格式数据。在HTML网页中,要想创建表格,就需要使用表格相关的标签。<table> <tr> <td>单元格内的文字</td> ...