Re: Generate random numbers in PL/SQL, any good ways? Is there an internal?

From: Dennis Moore <dbmoore_at_us.oracle.com>
Date: 16 Jul 1994 16:00:40 GMT
Message-ID: <309078$8rp_at_dcsun4.us.oracle.com>


I believe PL/SQL 2 (in Oracle7 and beyond) has a random number function. If you are on Oracle V6, you can use any standard algorithm in a textbook to generate a pseudo-random number, like by using the date or some other environmentally-likely-to-be-random key.

  • Dennis Moore, my own opinions, etcetcetc

In article <774142568snz_at_aboy.demon.co.uk> MarkB_at_aboy.demon.co.uk writes:
>In article <d7hansl.774016863_at_dtek.chalmers.se>
> d7hansl_at_dtek.chalmers.se "Hans Lindberg" writes:
>
>> Hi!
>> I'm looking for a way to generate test data with certain probabilities
>> for the different values of the data. I can't find any random number
>> generator in neither the SQL ref man nor the PL/SQL ditto. Am I missing
>> the obvious or isn't there any? Do I have to implement a my own random
>
>Einstein said "Only God can be random." So you need a very good freelancer.
>
>In fact, randomness is a non-relational idea. What you have is a variant
>of the 'table of dates' problem - how do we generate output to tell us nothing
>happened on a day when there's no data for the day to drive the query.
>Oracle is not good at this.
>
>In fact, without wishing to step outside the boundaries of the group, I would
>suggest that randomness is by definition unprogrammable. What you could
>do, however, is write a program that makes no *relational* sense but pulls you
>back a whole bunch of rowids that you sould substring to numeric format.
>
>This would not truly be random, but it would at least be unpredictable.
>
>
>M
>--
>-----------------------------------------------------------------------------
> MarkB_at_aboy.demon.co.uk
>Lyric Quiz of the Week: "One and one and one is three..."
Received on Sat Jul 16 1994 - 18:00:40 CEST

Original text of this message