Home » SQL & PL/SQL » SQL & PL/SQL » Random Number ?
Random Number ? [message #11207] Sun, 14 March 2004 00:07 Go to next message
Rishi
Messages: 63
Registered: January 2001
Member
Is there any function to generate random number in Oracle 9i....????

If yes would love to know the details of the same from your side.

Regards
Rishi
Re: Random Number ? [message #11208 is a reply to message #11207] Sun, 14 March 2004 00:32 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Hi,

Look at the Oracle supplied DBMS_RANDOM package.

Alternatively, download the "Random number/ string generator package" script from this site (Scripts -> Pl/SQL Scripts).

Best regards.

Frank
Re: Random Number ? [message #11211 is a reply to message #11207] Sun, 14 March 2004 08:17 Go to previous message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
Oddly, the documentation does not mention DBMS_RANDOM.VALUE(low,high) which returns a value in the range [[low]] to [[high]], even though this has been available since 8i or earlier. e.g:
SQL> select dbms_random.value(5,10) from dual;

DBMS_RANDOM.VALUE(5,10)
-----------------------
             8.77627627

1 row selected.
Looks like the documentation has been revised in 10g.
Previous Topic: Disadvantages of NORMALIZATION
Next Topic: Can I change the Color Scheme?
Goto Forum:
  


Current Time: Thu Apr 25 03:28:34 CDT 2024