structure of table:create table TEST_TABLE
(
  A        VARCHAR2(32) not null,
  B        CHAR(1) default 'N' not null,
  C        CHAR(1) default 'N' not null
)when i excute below script encounter error!
 insert into TEST_TABLE values('######',null,null);ORA-01400 can not insert NULL to TEST_TABLE.Bdo anyone can tell me why?thanks!

解决方案 »

  1.   

    晕,你的表结构中,字段B C都是not null,当然不能插入null了。
      

  2.   

    你要想插入null,应该这样。insert   into   TEST_TABLE   values('######','null','null'); 
      

  3.   

    楼上的,他那两个字段是char(1),插不了四个字符的
      

  4.   

    oracle 中需要正确理解 字段值 is null 、is not null 、没有赋值的变量。
    没有赋值的变量  相当于c++中定义没有赋值的指针
      

  5.   

    create   table   TEST_TABLE 

        A                 VARCHAR2(32)   not   null, 
        B                 CHAR(1)   default   'N'   not   null, 
        C                 CHAR(1)   default   'N'   not   null 
    ) but i have default value here.
    when insert into table NULL will be replaced by 'N'???
      

  6.   

    如果要插入默认值,对应的列在插入语句中不要指定,忽略。用如下语句:insert   into   TEST_TABLE (A) values  ('######');
      

  7.   

    I aslo want to know why?
    what was the constraint to work .