Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: CREATING SEQUENCES - HELP PLEASE
Though This is the Most Obvious Solution, there are drawbacks. What if I do a Bulk Insert of say, a 1000 Records and then Rollback ? The Sequence Number would greatly differ.
Sunder Rajan.
Ed Bradt wrote:
> Javier Riera wrote:
> >
> > I am trying to build a table where the identifier must
autocalculates
> > its own value. Has the sequence object this property?
> > I created a secuence as:
> >
> > CREATE SEQUENCE miSeq
> > INCREMENT BY 1
> > START WITH 0
> > MINVALUE 0
> > MAXVALUE 9999999
> > NOCYCLE
> > CACHE 20
> > NOORDER
> > ;
> >
> > How can I assign this sequence to my table's identifier?
> >
> > Thanks.
>
> create a before insert triger that assigns miSeq.nextval as the values
>
> of your column.
> Ed Bradt
Received on Thu Oct 23 1997 - 00:00:00 CDT