how to get result into spool file [message #185310] |
Tue, 01 August 2006 02:48  |
mape
Messages: 298 Registered: July 2006 Location: Slovakia
|
Senior Member |
|
|
Hi
I want to get the result into the spool file but how to do that?
I call procedure from this unix script:
#!/usr/bin/ksh
sqlplus -s xx/xx@yyy @proc.tst <<END_SCRIPT >> log.txt
END_SCRIPT
And procedure proc.tst looks:
declare
begin
dbms_output.put_line('here is result');
end;
/
|
|
|
|
|
|
|
|
Re: how to get result into spool file [message #185346 is a reply to message #185310] |
Tue, 01 August 2006 05:20   |
mape
Messages: 298 Registered: July 2006 Location: Slovakia
|
Senior Member |
|
|
this is anonymous PL/SQL block of course.
I got the output into the file like this
sqlplus -s xx/xx@yy @proc.tst <<END_SCRIPT > log.txt
END_SCRIPT
But it didnt help.
The result on the output file is:
PL/SQL procedure successfully completed.
thats all
|
|
|
|
Re: how to get result into spool file [message #185352 is a reply to message #185310] |
Tue, 01 August 2006 05:32   |
mape
Messages: 298 Registered: July 2006 Location: Slovakia
|
Senior Member |
|
|
thanks a lot
its working
I have to put "set serveroutput on" on the beginning of PL/SQL.
I tried to get this statement on the beginning of unix script like this, but it was not right.
sqlplus -s xx/xx@yy @proc.tst <<END_SCRIPT > log.txt
SET SERVEROUTPUT ON
END_SCRIPT
Thanks a again.
|
|
|
Re: how to get result into spool file [message #185564 is a reply to message #185330] |
Wed, 02 August 2006 06:21  |
shrichandray
Messages: 2 Registered: August 2006 Location: BANGALORE
|
Junior Member |
|
|
#!/bin/sh
sqlplus -s xx/xxx@123 <<EOFF > log.txt
set heading off
set feedback off
set verify off
set termout on
set linesize 10000
set pages 0
set serveroutput on
spool xyz
@proc.tst
spool off
EOFF
end_of script
Now check you xyz.lst or log.txt file.
|
|
|