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 -> Generating the next sequential key...

Generating the next sequential key...

From: <timasmith_at_hotmail.com>
Date: 1 May 2006 09:22:56 -0700
Message-ID: <1146500576.157993.113620@j33g2000cwa.googlegroups.com>


Hi,

I have this app which is relatively database independent. I would like to serve the smallest scale (MS Access) up to the largest database server (Oracle).

I recoginize that I will need to write database specific code for Oracle i.e. generate the next number from a sequence.

For the rest I pondered this idea...

  1. Have a table with a row per database table and the last number used in it. pro's: nice sequential number con's: contention to get the next number (maybe grab a few at a time ugh)
  2. Generate a random number between 1 and 1000000000 pro's: very fast con's 1 in a billion chance to create a duplicate (maybe try the insert again if it happens?)

Are there other strategies I am missing?

thanks

Tim Received on Mon May 01 2006 - 11:22:56 CDT

Original text of this message

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