Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Generate random number
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
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
![]() |
![]() |