Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: random numbers
A copy of this was sent to Connor McDonald <connor_mcdonald_at_yahoo.com>
(if that email address didn't require changing)
On Wed, 10 Nov 1999 19:08:03 +0800, you wrote:
>Thomas Kyte wrote:
>>
>> A copy of this was sent to marcus_chan_at_my-deja.com
>> (if that email address didn't require changing)
>> On Wed, 10 Nov 1999 10:01:22 GMT, you wrote:
>>
>> >Hello,
>> >
>> >Does Oracle provides function "random generation of unique numbers"?
>> >thanks
>> >
>>
>> no.
>>
>> there is a random number generator (dbms_random) but it will generate the same
>> number.
>>
>> there are sequences which generate unique (but predictable) numbers.
>>
>> what are you trying to do? maybe we can suggest a way to do that.
>>
>> >marcus
[snip[
>
>You can set up the linear congruential generator to give a non-repeating
>set of "random" numbers.
>
unless the number generator could return +- infinity -- it must repeat at some point (finite set of numbers = repeats at some time). In a finite set of numbers, repitition is unavoidable.
What they mean by "non-repeating" is that it doesn't generate a repeating pattern of numbers -- the same number will appear in the set over and over but the set itself will not "repeat" (eg: rational numbers generate repeating sets of numbers but PI and E and other irrational numbers do not. You could use the formula for PI to generate a non-repeating set of random numbers).
They have algorithms to generate random numbers that do not become predicable over time but do return the same number over time.
>www.nr.com has some algorithms to do so, although I'd be curious in
>knowing what the original poster had in mind...
>
>Cheers
>Connor
--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Nov 10 1999 - 14:35:39 CST
![]() |
![]() |