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: Creating Sequence for Auto Number

Re: Creating Sequence for Auto Number

From: <jkipp_at_my-deja.com>
Date: Mon, 20 Nov 2000 20:43:40 GMT
Message-ID: <8vc2dq$v49$1@nnrp1.deja.com>

In article <8vc0ic$tbi$1_at_nnrp1.deja.com>,   David Fitzjarrell <oratune_at_aol.com> wrote:
> In our last gripping episode jkipp_at_my-deja.com wrote:
> >
> > > >
> > >
> > > If you are not coding an application to perform such duties then,
 yes,
> > > a trigger will be necessary to populate your 'auto-number' column.
 And
> > > this can be tricky, as you may well receive 'mutating table'
 errors.
> > > To alleviate this you should visit
> > > http://govt.us.oracle.com/~tkyte/Mutate/index.html where Tom Kyte
> > > discusses this and provides excellent solutions.
> > >
> > > If you are coding an application to insert/update/delete/select
 data
> > > from your table then a database trigger will not be necessary.
 Code
> > > your application to utilize the sequence to populate the 'auto-
 number'
> > > column:
> > >
> > > ...
> > > select auto_seq.nextval
> > > into new_seq
> > > from dual;
> > > ...
> > > insert into ....
> > > values
> > > (new_seq, :blk1.value, :blk1.value2, ...)
> > > ...
> > >
> > > Of course, this example is for Oracle Forms (thus the :blk1
> > > descriptors), but any application would be coded to perform
 similar
> > > operations.
> > >
> > ------------
> >
> > All of the data will be entered via an Access form. So with this in
> > mind, could I just tell Access to auto-increment in the form or do I
> > still need to do something on the ORacle end?
> >
> > THanks
> > Jim
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >

>

> I believe you can ask Access to generate values for a column but don't
> quote me on that -- check your documentation. It may be that Access
> will need the sequence to generate numbers.
>

I found out that it is better to use a sequence and a trigger in case records were loaded into the oracle database from a different source besides the Access form.
Thanks for the help
Jim

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Nov 20 2000 - 14:43:40 CST

Original text of this message

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