DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: ORA-01400: cannot insert NULL into

  1. #1
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    195

    ORA-01400: cannot insert NULL into

    Why can't I insert a blank string into a NOT NULL colum?

    insert into t1 values(2,'');
    ORA-01400: cannot insert NULL into ("TEST1"."T1"."C2")

    My table is:
    create table t1(c1 int,c2 varchar2(10) not null);

    Any idea?

  2. #2
    Join Date
    Mar 2002
    Posts
    534
    for Oracle a blank string is a NULL. So you will not be able to insert a blank into a NOT NULL column

  3. #3
    Join Date
    Nov 2002
    Location
    Mooresville, NC
    Posts
    349
    You add a NOT NULL constraint and then inserting a NULL value??
    Are you trying to do something like this?
    insert into t1 values(2,' ');
    This will work as there is a space.
    http://www.perf-engg.com
    A performance engineering forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width