I have this function and i want different row numbers between (4,8) for example. but it always returns me 4..
How can i have different row numbers every time?
CREATE OR REPLACE FUNCTION CUSTOMERS_DATA(
P_MIN_CUSTOMERS NUMBER,
P_MAX_CUSTOMERS NUMBER)
RETURN NUMBER AS
N PLS_INTEGER;
CUSTOMER_DATA_ID NUMBER;
BEGIN
N := dbms_random.value(P_MIN_CUSTOMERS,P_MAX_CUSTOMERS);
FOR LOOP_COUNTER IN 1..N
LOOP
CUSTOMER_DATA_ID := ADD_CUSTOMERS(dbms_random.string('X',10),
dbms_random.string('X',30),
dbms_random.string('X',10));
END LOOP;
RETURN CUSTOMER_DATA_ID;
END CUSTOMERS_DATA;
DECLARE
I_ITEMS_ID NUMBER;
BEGIN
DELETE FROM MINI_ERP.ITEMS;
I_ITEMS_ID := MINI_ERP.ITEMS_DATA(5,10);
END;
Aucun commentaire:
Enregistrer un commentaire