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 -> Distinct Random Number Generation

Distinct Random Number Generation

From: Matthew D. Heilman <matthew.d.heilman_at_ac.com>
Date: Fri, 15 May 1998 10:36:19 -0400
Message-ID: <355c52c60000000f@news.accincy.com-MINC>


Here is the scenario. I want to generate a unique number so I can assign it as the indentifier of some attribute. I have a table that looks like:

product_ID NUMBER(10) --Primiary key
product_descr VARCHAR2(255)

So, each time I have a new product_descr I want to assign it a unique product_ID. I was planning to have the font end generate a random number(or even have oracle do it) and then check if this number already exists in the table. But I do not want to have to query the table each time to see if a newly generated random number exists. I also can not use a counter, because I will be deleting products and I may run out of number eventually(I will be processing HUGE amounts of products).

Any suggestions? Received on Fri May 15 1998 - 09:36:19 CDT

Original text of this message

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