i am just throwing some more light on random
DECLARE
v_random number;
BEGIN
dbms_random.seed(TO_CHAR(SYSDATE,'MM-DD-YYYY HH24:MI:SS'));
--
FOR i IN 1 .. 5
LOOP
v_random := dbms_random.value(0,1);
dbms_output.put_line(v_random);
END LOOP;
END;
Printable View
i am just throwing some more light on random
DECLARE
v_random number;
BEGIN
dbms_random.seed(TO_CHAR(SYSDATE,'MM-DD-YYYY HH24:MI:SS'));
--
FOR i IN 1 .. 5
LOOP
v_random := dbms_random.value(0,1);
dbms_output.put_line(v_random);
END LOOP;
END;
Vijay,
Your DBMS_RANDOM package is obviously not the package that Oracle supplies in its distribution from 8.0 onward. Yours must be one of those home made PL/SQL random generators that were available on the internet for releases 7.*. Obviously you have named this home made package with the same name oracle names its built-in random generator: DBMS_RANDOM (although I would strongly discourage the usage of the built-in names for user generated objects).
Why the DBMS_RANDOM from your code could not be original SYS.DBMS_RANDOM package?
1.) There is no function DBMS_RANDOM.VALUE in original package
2.) DBMS_RANDOM.SEED procedure accepts only BYNARY_INTEGER parameter, while you parameter is string with nonnumerical characters
3.) You must first initialize the package (supply an initial seed value) with DBMS_RANDOM.SEED procedure before you start using it
yes! jmodic is the dude/dudette. thanks for the example.