Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: generate random numbers
"Vince .>" <vincent@<remove> wrote in message
news:0vje71pueo53r2dmd30fr46iv35u7d474l_at_4ax.com...
> hi there !
>
> I would like to use random numbers in my pl/sql code..
> do I really need to user dbms_random package or there is another to do
> so ?
> if so, how could I use dbms_random to generate positive random
> numbers??
>
> thanks a lot..
> Vince
I would use the package. It generates numbers between 0 and 1 so just
multiply the result by the number you want. (eg 0 to 6 multiply by 6) You
could write your own. (why?) Most people use a linear congruency generator
method. (google is your friend)
Jim
Received on Tue May 03 2005 - 06:24:16 CDT