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: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Tue, 21 Nov 2000 22:14:44 +0800
Message-ID: <3A1A8354.4B2@yahoo.com>

jkipp_at_my-deja.com wrote:
>
> 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.

and http://www.oracledba.co.uk/tips/seq_after_insert.htm

may also be of assistance...

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk (mirrored at
http://www.oradba.freeserve.co.uk)

(Apologies for not replying to any emails - YAHOO have a dead server)

"Early to bed and early to rise, 
 makes a man healthy, wealthy and wise." - some dead guy
Received on Tue Nov 21 2000 - 08:14:44 CST

Original text of this message

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