Home » SQL & PL/SQL » SQL & PL/SQL » sql script error output (oracle 9i)
sql script error output [message #311508] Fri, 04 April 2008 12:08 Go to next message
poratips
Messages: 345
Registered: April 2005
Location: IL
Senior Member

Hi,
I have to run frequenlty oracle sql scripts which sometimes insert/update/delete the records in different tables and after running i have to send an error messages to user but each time i have to clean up the log and bundle only error messages and send them.
Is it any way i can output only error sqls with messages and send them?
I am runnning script like:

sql*plus> spool run_script.log
sql*plus>@run_script.sql
1 row created.
...
1 row updated.
..
..
commit;
spool off

Then i am pulling this file and cleacn up all created/updated messages and then cleaning up blank spaces and send them only error sqls with messages.
Is it any way i can run the script and get seperately error messages and send them?

Thanks lot,
poratips

[Updated on: Fri, 04 April 2008 12:08] by Moderator

Report message to a moderator

Re: sql script error output [message #311511 is a reply to message #311508] Fri, 04 April 2008 12:10 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
set echo off
set verify off
set showmode off
set feedback off

then you only have error messages.

By the way don't put the WHOLE post between code tags, just code.

Regards
Michel

[Updated on: Fri, 04 April 2008 12:12]

Report message to a moderator

Re: sql script error output [message #311531 is a reply to message #311511] Fri, 04 April 2008 12:41 Go to previous messageGo to next message
poratips
Messages: 345
Registered: April 2005
Location: IL
Senior Member
Thanks much.
What about if i need both messages, error and correctly run sql messages like 1 row created, 1 row updated.

Thanks,
Re: sql script error output [message #311534 is a reply to message #311531] Fri, 04 April 2008 12:46 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If you set what I said there is no more these messages.

Regards
Michel
Re: sql script error output [message #311553 is a reply to message #311534] Fri, 04 April 2008 14:52 Go to previous messageGo to next message
poratips
Messages: 345
Registered: April 2005
Location: IL
Senior Member
Thanks.
Is it any procedural way you can throw corrects msg and error msg in seperate files?

Regards,
Prashant Shah
Re: sql script error output [message #311563 is a reply to message #311553] Fri, 04 April 2008 15:36 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No.
Or pack all your statements in a PL/SQL block, open 2 files, trap all errors and write in one or the other file depending on the result.

Regards
Michel

[Updated on: Fri, 04 April 2008 15:36]

Report message to a moderator

Re: sql script error output [message #311595 is a reply to message #311563] Fri, 04 April 2008 22:40 Go to previous message
poratips
Messages: 345
Registered: April 2005
Location: IL
Senior Member
Thanks.
Previous Topic: Huge Query
Next Topic: Rounding Decimal Numbers
Goto Forum:
  


Current Time: Mon Dec 05 19:03:56 CST 2016

Total time taken to generate the page: 0.19111 seconds