Home » SQL & PL/SQL » SQL & PL/SQL » Why true argument is used in Raise_application_error?
Why true argument is used in Raise_application_error? [message #244255] Tue, 12 June 2007 03:10 Go to next message
orafacjublu
Messages: 95
Registered: May 2006
Location: KOLKATA
Member
From the oracle document I found that Raise_application_error can take a third argument TRUE/FALSE .If it is true then it gets into the error stack. Can anyone kindly elaborate me what exactly gets stored in the stack; whether the stack is a data-dictionary table or view ? pls clear. Kindly give me an example
of the real life application of using raise_application_error with the true argument eg. raise_application_error(-20000,message_text,TRUE)
Re: Why true argument is used in Raise_application_error? [message #244257 is a reply to message #244255] Tue, 12 June 2007 03:15 Go to previous messageGo to next message
sanka_yanka
Messages: 184
Registered: October 2005
Location: Kolkata
Senior Member

See the link:
http://www.fast-track.cc/t_easyoracle_pl_sql_raise_application_error.htm

I think this will help you to clear the idea.

Regards
Sanka Razz
Re: Why true argument is used in Raise_application_error? [message #244261 is a reply to message #244255] Tue, 12 June 2007 03:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL> begin
  2    raise_application_error (-20001,'First error');
  3  exception
  4    when others then
  5      raise_application_error (-20002,'Second error',false);
  6  end;
  7  /
begin
*
ERROR at line 1:
ORA-20002: Second error
ORA-06512: at line 5


SQL> begin
  2    raise_application_error (-20001,'First error');
  3  exception
  4    when others then
  5      raise_application_error (-20002,'Second error',true);
  6  end;
  7  /
begin
*
ERROR at line 1:
ORA-20002: Second error
ORA-06512: at line 5
ORA-20001: First error

When FALSE, the second message REPLACE the first one.
When TRUE, the second message is ADDED to the first one.

Regards
Michel
Re: Why true argument is used in Raise_application_error? [message #244273 is a reply to message #244255] Tue, 12 June 2007 04:02 Go to previous messageGo to next message
orafacjublu
Messages: 95
Registered: May 2006
Location: KOLKATA
Member
Thanks Mitchel for the example . Now kindly tell me what this error stack is ? Is it a temporary table,data-dictionary,or view. How the error gets stored there
Re: Why true argument is used in Raise_application_error? [message #244277 is a reply to message #244273] Tue, 12 June 2007 04:05 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
It is in the program stack like any other error stack.

Regards
Michel
Re: Why true argument is used in Raise_application_error? [message #244281 is a reply to message #244277] Tue, 12 June 2007 04:24 Go to previous messageGo to next message
orafacjublu
Messages: 95
Registered: May 2006
Location: KOLKATA
Member
Bon , That means the heap memory in the ram,then if we shutdown the database then next time i won't get it in the stack. Is there no dynamic performance view where I can get information of these errors in the stack?
Re: Why true argument is used in Raise_application_error? [message #244298 is a reply to message #244281] Tue, 12 June 2007 05:12 Go to previous message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
If you shutdown the database, the program (I mean the Oracle process behind your program) shutdowns and there is no more error stack or nothing else.

Think, where is the error stack of your Notepad if you shutdown the PC?

Regards
Michel
Previous Topic: How can I stop a job at a particular time.
Next Topic: system name
Goto Forum:
  


Current Time: Fri Dec 13 05:22:25 CST 2024