jeudi 25 novembre 2021

How to select a random value from an associative array in PL/SQL?

I have an associative array full of data how to select a random data from there?

declare
TYPE r_emp_id IS TABLE OF NUMBER;
    emps r_emp_id;
begin
select employes_id into emps from employes order by employes_id;

for i in <(random number of employes_id from emps)> loop

DBMS_OUTPUT.put_line(employes_id (i)); 
end loop;
end;



Aucun commentaire:

Enregistrer un commentaire