Re: How to Randomly Generate a Value
Date: 1996/01/14
Message-ID: <4dbf4v$rtv_at_tiete.dcc.unicamp.br>#1/1
DAGMARA_at_news.delphi.com (DAGMARA_at_DELPHI.COM) wrote:
>I have a client who wishes to randomly generate a number using SQL. I
>don't know of any ORACLE function that will do this; but perhaps this
>may be a new or unsupported function someone knows about? How are others
>doing this?
You can get any pseudo-random number generator from your college books and code it into PL/SQL.
The only problem is that you'll have one seed variable for each Oracle connection. Because of this, it's possible to have each user generating the same random number sequence. To avoid this problem, you can initialize the seed variable with a function of the current time, Oracle's SCN or other dynamic number existing in your environment.
Regards,
Carlos Netto
cnetto_at_cps.softex.br
Software Design - Oracle Consultants - Brazil
Received on Sun Jan 14 1996 - 00:00:00 CET