Hi Friends,
I am trying to use the spool command to spool multiple sql statements into one file and then want to do some analysis on that sql text by using shell scripts.
Problem is i am not able to generate a separate spool file in pl/sql . i googled and found that we cannot use sqlplus command inside pl/sql.
Can anyone please suggest me some workaround to achieve my objective?
Below is simplified code for showing what i want to get.
set serveroutput on
declare
i number:=0;
begin
for s in 1..10
loop
i:= i+ 1;
execute immediate 'spool querytext_'||i||'';
dbms_output.put_line(chr(10));
dbms_output.put_line(i);
end loop;
end;
/
Regds.
Sachin