现需要在已有数据的表中添加某个字段,不知道会产生什么影响?

解决方案 »

  1.   

    SQL> desc t1;
    Name Type       Nullable Default Comments 
    ---- ---------- -------- ------- -------- 
    ID   NUMBER(10)                           
     
    SQL> alter table t1 add name varchar2(10);
     
    Table altered
     
    SQL> alter table t1 drop column name;
     
    Table altered
     
    SQL> alter table t1 add name varchar2(10) not null;
     
    alter table t1 add name varchar2(10) not null
     
    ORA-01758: 要添加必需的 (NOT NULL) 列, 则表必须为空
     
    SQL> alter table t1 add name varchaR2(10) default 100 not null ;
     
    Table altered
     
    SQL> 
    其他的好像没什么可注意的
      

  2.   

    列的顺序可能会变
    如果你取值时 用的是select * from tablename,然后是result.rows[0][0]这样的话,程序就要改了
    其他的也没什么