Naveen
Naveen

Reputation: 197

Logging .sql file output to log file in shell script

I have an sql file being called from shell script, and I want to capture the output of the execution into a log file. I am trying to capture by appending redirecting to log file like this >> log.txt but it is not working.

What do I need to do to fix it?

sqlplus -s ${USER}/${PWD}@${DATABASE} << EOF
@${LOADDIR}/VV_validation.sql
EOF'

Upvotes: 0

Views: 4715

Answers (1)

StephaneM
StephaneM

Reputation: 4899

Try this:

sqlplus -s ${USER}/${PWD}@${DATABASE}
spool your_file_name.log
@@${LOADDIR}/VV_validation.sql
spool off

Upvotes: 1

Related Questions