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

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to Generate Auto Number

Re: How to Generate Auto Number

From: Gary <garygfx_at_hotmail.com>
Date: Sat, 2 Sep 2000 09:31:23 +0100
Message-ID: <8oqdq0$ell$1@neptunium.btinternet.com>

I'm creating a unique number using my application server for each new record. I'm using ColdFusion to do this, but you could just as easily use ASP, PHP, or Perl. Write a few lines of code that create a unique ID, ideally based on the current date and time (to the second) with at least 5 digits or totally random numbers. This will ensure no IDs will be identical. If you are planning to share the data with other databases then you may need to add more random digits or other unique values to make your IDs even more unique. When you insert a new record to the db, include your unique ID and depending on your application this field should also be your primary key and perhaps indexed too.

Gary.

Arun Solleti <solleti_at_eng.usf.edu> wrote in message news:39B02564.3EEF7393_at_eng.usf.edu...
> Hi
>
> Can anyone tell me, what is the data type which will generate a primary
> key for a given table. It is like AutoNumber in access which can be set
> as the primary key. How to set the starting point for this and
> incremental value.
>
> Thanks
> Arun
>
Received on Sat Sep 02 2000 - 03:31:23 CDT

Original text of this message

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