修改数据库表字段

来源:互联网 发布:java项目开发案例下载 编辑:程序博客网 时间:2024/04/29 01:54
alter   table   your_table   add   (column1   col_type1,clumn2   col_type2...);  
  your_table   :表名  
  column1/column2   :字段名  
  col_type1/col_type2   :字段类型  
  建议用过程实现添加字段,屏蔽掉字段已经存在所造成的错误。另外,一次添加一个字段会更好一些。  
  declare  
  vstr_sql   varchar2(2000):='alter   table   your_table   add   (column1   col_type1,clumn2   col_type2...)';  
  begin  
  execute   immediate   vstr_sql;  
  end;  
  /  
0 0