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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Generate random number

RE: Generate random number

From: Scott Crabtree <scott_at_psscorp.com>
Date: Sun, 01 Apr 2001 13:36:19 -0700
Message-ID: <F001.002DDE60.20010401131018@fatcity.com>

Helmut,

        Make sure you have run dbmsrand.sql as sys. This installs the dbms_random package

First you seed the random package.

exec dbms_random.seed(99991)

Then

select dbms_random.random from dual;

    RANDOM



 723648616

exec DBMS_RANDOM.TERMINATE;

RTFM Reference (Oracle8i Supplied PL/SQL Packages Reference)

HTH, Scott Crabtree

-----Original Message-----
Sent: Saturday, March 31, 2001 7:00 PM
To: Multiple recipients of list ORACLE-L

Hi!

Is there a function in Oracle that returns a random number, when it's called?

e.g. rnd (1,1000) should return a random number between 1 and 1000.

This is 8.1.6 on Win2k.

Thanks,
Helmut

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Scott Crabtree
  INET: scott_at_psscorp.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Sun Apr 01 2001 - 15:36:19 CDT

Original text of this message

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