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: How to assign a sequence value as a default for a column

Re: How to assign a sequence value as a default for a column

From: Peter Laursen <spork_at_get2net.dk>
Date: Wed, 14 Jul 1999 00:01:20 +0200
Message-ID: <yLOi3.526$Ax.917@news.get2net.dk>


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

Original text of this message

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