Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBMS_RANDOM.VALUE data distribution

ashumOct 14 2022

Hello,
I am using the code below to generate some random integers:
DECLARE
v_value NUMBER :=0;
BEGIN
for i IN 1..10
LOOP
v_value := v_value + ROUND(DBMS_RANDOM.VALUE(1,999));
END LOOP ;
DBMS_OUTPUT.Put_Line(v_value);
END;
I see a problem with the random values distribution since when I sum the values generated, the total is always around the same range 3,000 to 6,000.
Is there any way I can change the distribution of the random values generated?
Regards,

Comments
Post Details
Added on Oct 14 2022
6 comments
1,029 views