Home » SQL & PL/SQL » SQL & PL/SQL » how to check return status and write to the log file?
how to check return status and write to the log file? [message #190435] Wed, 30 August 2006 13:33 Go to next message
napobo3
Messages: 2
Registered: July 2006
Junior Member
Please help me to do two simple things from my sqlplus procedure.
In my sqlplus script I am dynamically creating the scripts using the
SPOOL RUN.SQL
...
SPOOL OFF

and then - run the created script using
@RUN

What I need is - to check the return status of an executed script within the main script and to send a line "RUN.SQL completed" to the log file.

Your help will be appreciated very much.








Re: how to check return status and write to the log file? [message #190460 is a reply to message #190435] Wed, 30 August 2006 21:29 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
When your only tool is a hammer, all problems look like nails.
Trying to use a hammer to cut a 2x4 into two pieces is a suboptimal tool choice.
Other tools are available to achieve your goal & will require less effort to complete.
Alternatively you could just use SQL's "IF" statement.
Re: how to check return status and write to the log file? [message #190523 is a reply to message #190460] Thu, 31 August 2006 03:05 Go to previous message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
Unfortunately the START command cannot return a status. Some alternatives:

- Spool code in PL/SQL syntax. Catch errors with an EXCEPTION handler.

- Exit the session with the WHENEVER SQLERROR ... command.
Previous Topic: Query on 'AFTER INSERT ON '
Next Topic: how can i make a table
Goto Forum:
  


Current Time: Thu Dec 08 08:18:44 CST 2016

Total time taken to generate the page: 0.16854 seconds