I have a PL/SQL statement that should iterate through a select statement, execute a stored procedure and then select something from a table.
The statement looks like the one below:
BEGIN
FOR r IN (
select org_id ,name from table2 order by 1
) LOOP
dbms_application_info.set_cl (r.org_id);
Select prj_id, prj_name
INTO l_output
FROM table1
WHERE CREATION_DATE>TO_DATE('10/01/2017','DD-MM-YYYY');
dbms_sql.return_result(l_output); --error
END LOOP;
END;
I don't know how to display all the rows returned by the query. Could someone try to help me figure this out? I searched for a solution but without any luck until now..
PS: Table1 is a view that needs to have the stored procedure initiated before the select
Thanks in advance!