空字符串就是null,当然不能插入非空项

解决方案 »

  1.   

    各们大侠
    not null约束的是'' 还是nullnull好像不是''
      

  2.   

    可以这么做:
      alter table 表名 disable 约束名  novalidate;
      insert into 
      commit;
      alter table 表名 enable 约束名  novalidate;建议大家多看看itpub上的关于约束状态的帖子。   
      

  3.   

    在oracle中declare
      v_temp varchar2(10);
    begin
      v_temp := '';
    end;
    /和
    declare
      v_temp varchar2(10);
    begin
      v_temp := null;
    end;
    /效果是等价的
      

  4.   

    同样
    insert into tbl_temp(name) values('');

    insert into tbl_temp(name) values(null);
    也是等价的