Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: A question about Randomness in Oracle?

Re: A question about Randomness in Oracle?

From: Douglas Hawthorne <douglashawthorne_at_yahoo.com.au>
Date: Fri, 19 Mar 2004 00:33:27 GMT
Message-ID: <rdr6c.110110$Wa.92009@news-server.bigpond.net.au>


"Paul" <paul_at_not.a.chance.ie> wrote in message news:MPG.1ac40525478d32c298990d_at_news1.eircom.net...
>
>
> Hi all,
>
>
> I have been looking at
>
> F:\oracle\ora92\rdbms\admin\dbmsrand.sql
>
> It says
>
> "This is a random number generator. Do not use for cryptography"
>
>
> Do Oracle publish any details of the algorithm they use to generate
> these numbers?
>
>
> Basically, what I have is a certain number of records, each with an
> integer (sequence), and I want to be able to do something like
>
> SELECT * FROM My_Table (RANDOM x 1000) ORDER BY My_Sequence
>
> or whatever the syntax is in Oracle. I want 1000 RANDOM records - i.e.
> if I do this tomorrow or the next day, I will get a completely different
> set of records. Is there an easy way to do this in Oracle?
>
>
> Paul...
>
>
> --
> plinehan y_a_h_o_o and d_o_t com
> C++ Builder 5 SP1, Interbase 6.0.1.6 IBX 5.04 W2K Pro
> Please do not top-post.
>
> "XML avoids the fundamental question of what we should do,
> by focusing entirely on how we should do it."
>
> quote from http://www.metatorial.com

Paul,

You can use the INITIALIZE or the SEED procedures within the DBMS_RANDOM package to generate differing or repeatable 'random' number sequences. The details of these procedures can be found in the "Supplied PL/SQL Packages and Types Reference" manual.

You may want to review
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:831827028200 for some more details on your question.

Also check out Daniel Morgan's comments at http://www.psoug.org/reference/dbms_random.html for a better solution to your problem.

Douglas Hawthorne Received on Thu Mar 18 2004 - 18:33:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US