Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Error: 'ORA-01400: cannot insert NULL into ('

Re: Error: 'ORA-01400: cannot insert NULL into ('

From: BicycleRepairman <engel.kevin_at_gmail.com>
Date: 22 Jan 2006 11:08:01 -0800
Message-ID: <1137956881.651314.289320@g47g2000cwa.googlegroups.com>


stealing from asktom.oracle.com...

...if all you want is a "surrogate key":

ps$tkyte_at_ORA10G> create table t ( x raw(16) default sys_guid(),

  2                   y varchar2(32) default sys_guid(),
  3                                   z varchar2(5) );

Table created.

ops$tkyte_at_ORA10G>
ops$tkyte_at_ORA10G>
ops$tkyte_at_ORA10G> insert into t (z) values ( 'hello' );

1 row created.

ops$tkyte_at_ORA10G> select * from t;

X                                Y                                Z
-------------------------------- -------------------------------- -----
0227D36794A61D44E040007F010061CC 0227D36794A71D44E040007F010061CC hello  

(using RAW would be best - but some people are 'afraid' of raw...) Received on Sun Jan 22 2006 - 13:08:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US