Re: Default sequence number

From: L. Tseng <lesliet_at_u.washington.edu>
Date: 1996/10/28
Message-ID: <553fjc$emv_at_nntp1.u.washington.edu>#1/1


But, even with the trigger, it still requires to specify the column list when doing the insert.

     INSERT INTO tablename VALUES (val2,val3,val4) won't work when
     tablename has (col1,col2,col3,col4) and col1 is the ID column.

Do you know why Oracle can't use NEXTVAL as default when creating a table?

   CREATE TABLE tablename (

      ID number DEFAULT seq_num.NEXTVAL)

In article <551sgn$5b_at_o.online.no>, Alf-Kenneth Aabel <alf-ka_at_online.no> wrote:
>nardone_at_patriot.net (Joe Nardone) wrote:
>
>
>>Unfortunately (this is from memory; please check it out) you won't
>>be able to declare your column NOT NULL. Apparently, Oracle checks
>>NOT NULL constraints before doing the 'before-insert' and 'before-update'
>>triggers.
 

>>Joe
>
>
>No, this is not true at least not in Oracle 7.2 and higher. Oracle
>will run the trigger before checking the constraints, so a trigger is
>the right way to implent the IDENTITY column which exists in Sybase.
>
>
>_____________________________________________________________
>Name: Alf-Kenneth Aabel
>Title: Senior Software Engineer
>Company name: PRIDE AS
>Address: Wdm. Thranesgt. 77
> 0175 OSLO
>
>Ph work: +47 22 20 21 50
>Fax: +47 22 20 70 39
>Ph private: +47 22 35 64 17
>Pager: +47 967 16998
>Email: alf-ka_at_online.no
>_____________________________________________________________
>
>
>
Received on Mon Oct 28 1996 - 00:00:00 CET

Original text of this message