VALUE functions
Translation reference for DBMS_RANDOM.VALUE.
Description
The basic function gets a random number, greater than or equal to 0 and less than 1. Alternatively, you can get a random Oracle number
X, whereXis greater than or equal tolowand less thanhigh. (Oracle PL/SQL DBMS_RANDOM.VALUE)
This UDF is implemented using the Math.random function of Javascript to replicate the functionality of Oracle DBMS_RANDOM.VALUE function.
Syntax
DBMS_RANDOM.VALUE()
RETURN NUMBER;
DBMS_RANDOM.VALUE(
low NUMBER,
high NUMBER)
RETURN NUMBER;Custom UDF overloads
Setup data
The DBMS_RANDOM schema must be created.
CREATE SCHEMA IF NOT EXISTS DBMS_RANDOM;DBMS_RANDOM.VALUE_UDF()
Parameters
No parameters.
Usage example
Oracle
Snowflake
DBMS_RANDOM.VALUE_UDF(NUMBER, NUMBER)
Parameters
low: The lowest
NUMBERfrom which a random number is generated. The number generated is greater than or equal tolow.high: The highest
NUMBERused as a limit when generating a random number. The number generated will be less thanhigh.
Usage example
Oracle
Snowflake
Known Issues
No issues were found.
Related EWIs
MSCEWI1020: CUSTOM UDF 'DBMS_RANDOM.VALUE' INSERTED.
MSCEWI3112: DBMS_RANDOM.VALUE DIGITS OF PRECISION IS LOWER IN SNOWFLAKE.
Last updated
Was this helpful?