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.
DBMS_RANDOM.VALUE
RETURN NUMBER;
DBMS_RANDOM.VALUE(
low IN NUMBER,
high IN NUMBER)
RETURN NUMBER;
The parameter low specifies the lowest number in a range from which to generate a random number. The number generated may be equal to low
The parameter high specifies the highest number below which to generate a random number. The number generated will be less than high
Examples
1. Generating a random number between 0 and 1
select dbms_random.value from dual;
0.43479573301642652177742938323830039513
2. Generating a random number from a range, between 1 to 1000
select dbms_random.value(1,1000) from dual;
330.387916712441729077598383255477731219
3. Generating a 14 digit random number
select dbms_random.value(10000000000000, 99999999999999) from dual;
89926505345163.88395060783333581957965101