美文网首页
oracle表字段操作

oracle表字段操作

作者: Crazy_MC | 来源:发表于2018-02-24 10:01 被阅读0次

添加字段

语法: 
alter table 表名 add (字段名 字段类型 默认值 是否为空);

示例:  
alter table sf_users add (HeadPIC blob);
alter table sf_users add (userName varchar2(30) default '空' not null);

删除字段

语法:
alter table 表名 drop column 字段名;

示例:
alter table sf_users drop column HeadPIC;

修改字段

语法:
alter table 表名 modify (字段名 字段类型 默认值 是否为空);

示例:
alter table sf_InvoiceApply modify (BILLCODE number(4));

字段重命名

语法:
alter table 表名 rename  column  列名 to 新列名

示例:
alter table sf_InvoiceApply rename column PIC to NEWPIC;

表重命名

语法:
alter table 表名 rename to  新表名

示例:
alter table sf_InvoiceApply rename to  sf_New_InvoiceApply;

相关文章

网友评论

      本文标题:oracle表字段操作

      本文链接:https://www.haomeiwen.com/subject/jyfqxftx.html