I'm curious if it is possible to have multiple Spool outputs within an Oracle Stored Procedure.
Basically, if a record hits a certain condition,in this case if it is located within the second loop, write it to one file. Else write it to another.
CODE example (receiving errors when assigning spool after BEGIN statement):
for r1 in c1 LOOP
v_found := 'N';
FOR r2 in c2(r1.name) LOOP
v_found := 'Y';
set spool on
spool \\location\OnTable.txt
dbms_output.put_line(r1.name || ' IS ON TABLE');
set spool off
END LOOP;
if v_found = 'N' then
spool \\location\NotOnTable.txt
dbms_output.put_line(r1.name || ' IS NOT ON TABLE');
end if;
END LOOP;
thanks,
Jerry
Basically, if a record hits a certain condition,in this case if it is located within the second loop, write it to one file. Else write it to another.
CODE example (receiving errors when assigning spool after BEGIN statement):
for r1 in c1 LOOP
v_found := 'N';
FOR r2 in c2(r1.name) LOOP
v_found := 'Y';
set spool on
spool \\location\OnTable.txt
dbms_output.put_line(r1.name || ' IS ON TABLE');
set spool off
END LOOP;
if v_found = 'N' then
spool \\location\NotOnTable.txt
dbms_output.put_line(r1.name || ' IS NOT ON TABLE');
end if;
END LOOP;
thanks,
Jerry