Home » SQL & PL/SQL » SQL & PL/SQL » Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? (Oracle 11g)
icon4.gif  Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? [message #522111] Tue, 06 September 2011 11:30 Go to next message
mr_hotshot_818
Messages: 25
Registered: October 2009
Junior Member

Using Raise_Application_Error in a trigger also returns ORA-06512 & ORA-04088 errors, in addition to the user defined error. Has anyone successfully suppressed ORA-06512 & ORA-04088 errors? Oracle states that it can be done using DBMS_UTILITY.FORMAT_ERROR_STACK but I have not gotten it to work.
Re: Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? [message #522112 is a reply to message #522111] Tue, 06 September 2011 11:32 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? [message #522113 is a reply to message #522111] Tue, 06 September 2011 11:41 Go to previous messageGo to next message
Michel Cadot
Messages: 68776
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
No you cannot stop Oracle to give the whole stack but the one that analyzes the error can remove it (using substring if it is a program, using his/her brain if he is human).

Regards
Michel
Re: Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? [message #522114 is a reply to message #522113] Tue, 06 September 2011 11:54 Go to previous messageGo to next message
mr_hotshot_818
Messages: 25
Registered: October 2009
Junior Member

Michel,

Check out Oracle Note 1005760.6

Quote:

[Edit MC: content of MOS copyrighted note removed]


Oracle says this will do the trick but I haven't gotten it to work.

[Updated on: Tue, 06 September 2011 12:05] by Moderator

Report message to a moderator

Re: Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? [message #522115 is a reply to message #522114] Tue, 06 September 2011 12:02 Go to previous messageGo to next message
cookiemonster
Messages: 13975
Registered: September 2008
Location: Rainy Manchester
Senior Member
Works for me:
SQL> set serveroutput on
SQL> BEGIN
  2  
  3  raise_application_error(-20001, 'blah');
  4  
  5  EXCEPTION WHEN OTHERS THEN dbms_output.put_line(dbms_utility.format_error_stack);
  6  END;
  7  /
ORA-20001: blah


PL/SQL procedure successfully completed.

SQL> 


What does it do for you?
Re: Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? [message #522116 is a reply to message #522114] Tue, 06 September 2011 12:04 Go to previous messageGo to next message
Michel Cadot
Messages: 68776
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Thanks to post it. I will warn T. Kyte, it will suggest him to make it remove.
This is a VERY BAD example that MUST NEVER be used.

In addition, it does not anything to what I said, the final program use substr or dbms_utility.format_error_stack which the same thing but embedded in a function call. You can do the same in your client program if you think the end user is not smart enough to do it with his brain.

Regards
Michel

[Updated on: Mon, 12 September 2011 11:48]

Report message to a moderator

Re: Suppressing ORA-06512 & ORA-04088 when using RAISE_APPLICATION_ERROR? [message #522117 is a reply to message #522116] Tue, 06 September 2011 12:18 Go to previous message
cookiemonster
Messages: 13975
Registered: September 2008
Location: Rainy Manchester
Senior Member
That note is misleading on a couple of levels.
1) Raise application error doesn't cause ORAA-06512. Oracles exception handling model causes ORA-06512
2) It implies that dbms_utility.format_error_stack only affects user defined errors, which is not the case. And while I might want to apply it user defined errors I definitely wouldn't want to apply it to other errors.
Which means you have to check the error number before deciding to use it.
Previous Topic: Foreign Key view in Oracle
Next Topic: TRUNC(sysdate, 'day') output different on local vs application oracle
Goto Forum:
  


Current Time: Sun Jun 14 21:37:02 CDT 2026