Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to assign a sequence value as a default for a column
Hi Vernon
You need to set up a trigger 'before insert' to fetch nextval and insert that value into your primary key. The default clause cannot fetch nextval.
Peter
Vernon Adams skrev i meddelelsen <378BA570.136E1924_at_ezgov.com>...
>I want to use a sequence to generate unique ids for records. I would
>like to setup the table such that the default value for the id column is
>the nextval from the sequence. I cannot seem to convince Oracle to do
>that.
>
>Does anyone know how I can accomplish this?
>
>Thanks,
>Vernon Adams
>
>
>
Received on Tue Jul 13 1999 - 17:01:20 CDT