Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to mimic MS Access 'Auto-Increment' Column

Re: How to mimic MS Access 'Auto-Increment' Column

From: Tom Mettling <mettling_at_erols.com>
Date: 1997/08/15
Message-ID: <33F4914D.C9328B9C@erols.com>#1/1

To mimic the Autoincrement feature, you need to use a sequence. Create the sequence to start wherever the last id is: create sequence xyz_sqc increment by 1 start with 100;

then when you are inserting a new record, you use xyz_seq.nextval as your "autoincrement" field value.

Tom Mettling
WT Chen & Company, Inc.

Paul Kilmer wrote:

> It is my task to replace the MS Access tables used in a small Call
> Tracking application with Oracle tables. The app is currently all in
> Access, using some VB code to manage inserts, updates, deletes. There
>
> are _no_ insert/update queries defined.
> Most of this task is very straightforward. However, a key column of
>
> one of the MS Access tables is defined as 'Auto-Increment'. Since
> there
> are no 'insert' Access queries defined in which I could have
> implemented
> the use of an Oracle sequence, I'm a little unsure of how to make this
>
> change.
> As I'm not an Access VB whiz, I'd be interested to hear any opinions
>
> or suggestions as to how you'd proceed.
>
> Regards,
> Paul
> ------------------------------
> Paul E. Kilmer
> Hershey Foods Corporation
> pkilmer_at_hersheys.com
> http://www.hersheys.com
> ------------------------------
Received on Fri Aug 15 1997 - 00:00:00 CDT

Original text of this message

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