oracle

语法结构如下:

alter table tablename add (column datatype [default value][null/not null],….);

alter table tablename modify (column datatype [default value][null/not null],….);

alter table tablename drop (column);

 例子:

增加列

alter table tablename  add USR_EmailValidate CHAR(1) default 'N' not null;

修改列

alter table tablename modify USR_EmailValidate CHAR(1) default 'Y'  null;

删除列

alter table tablename drop column  USR_EmailValidate;

 增加约束

alter table user
  add constraint FK_user_CLIENT foreign key (COMP_ID)
  references T_stal (COMP_ID);

 删除约束

alter table user drop constraint FK_user_CLIENT ; 

posted on 2013-06-04 19:16  houxiurong.com  阅读(243)  评论(0编辑  收藏  举报
< a href="http://houxiurong.com">houxiurong.com