The DBMS_RANDOM package provides a built-in random number generator. DBMS_RANDOM is not intended for cryptography.
Summary of DBMS_RANDOM Subprograms
Table 75-1 DBMS_RANDOM Package Subprograms
Subprogram
|
Description
|
INITIALIZE Procedure
|
Initializes the package with a seed value
|
NORMAL Function
|
Returns random numbers in a normal distribution
|
RANDOM Procedure
|
Generates a random number
|
SEED Procedures
|
Resets the seed
|
STRING Function
|
Gets a random string
|
TERMINATE Procedure
|
Terminates package
|
VALUE Functions
|
This function gets a random number, greater than or equal to 0 and less than 1, with 38 digits to the right of the decimal (38-digit precision), while the overloaded function gets a random Oracle number x, where x is greater than or equal to low and less than high
|
VALUE Functions
The basic function gets a random number, greater than or equal to 0 and less than 1, with 38 digits to the right of the decimal (38-digit precision). Alternatively, you can get a random Oracle number x, where x is greater than or equal to low and less than high.
Syntax
DBMS_RANDOM.VALUE RETURN NUMBER;DBMS_RANDOM.VALUE( low IN NUMBER, high IN NUMBER) RETURN NUMBER;
Parameters
Table 75-8 VALUE Function Parameters
Parameter
|
Description
|
low
|
The lowest number in a range from which to generate a random number. The number generated may be equal to low.
|
high
|
The highest number below which to generate a random number. The number generated will be less than high.
|
Return Values
VALUE Function Return Values
Parameter
|
Description
|
NUMBER
|
Returns an Oracle Number.
|