Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I want to redirect the output of a PL/SQL procedure to a log file. In this file I want to have all the output of the execution, the results of every step, errors, etc..
I have tried with a UNIX pipe ( >> sql_log.txt) and with spool sentences, but it dosen’t work.
Can anybody help me??
Attached the UNIX script which call the procedure.
Any advice will be greatly appreciated.
---
#!/bin/ksh
echo "Executing procedure pl/sql"
SQLPLUS="sqlplus -s /"
ESQUEMA="esquema1"
echo "\
call ${ESQUEMA}.Z_PROC_PRUEBA();" | $SQLPLUS
echo "Controlling pl/sql execution"
var_err=$?
if [ $var_err -gt 0 ]
then
echo "Error executing pl/sql"
else
echo "pl/sql finished sucessfully"
fi

you should do the spooling within SQL:
spool /directory/file;
sql...
sql...
sql...
spool off;cheers
Wollie

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |