Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Distinct Random Number Generation
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
![]() |
![]() |