Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

How to get RAISE_APPLICATION_ERROR message alone?

This is a discussion on How to get RAISE_APPLICATION_ERROR message alone? within the Oracle forums, part of the Databases category; How to get RAISE_APPLICATION_ERROR message alone? I have a stored procedure in which I have defined an Exception: childFound EXCEPTION; and the exception block looks like this EXCEPTION WHEN childFound ...

Go Back   Geeks Talk > Databases > Oracle
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Oracle Oracle 9i & Oracle 10g Knowledge Base Learn and Share Oracle Technology related articles, white papers, tutorials / study materials, example codes, FAQ's, Tips and Tricks.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-26-2007
Junior Member
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Anasuya1031 is on a distinguished road
How to get RAISE_APPLICATION_ERROR message alone?

How to get RAISE_APPLICATION_ERROR message alone?

I have a stored procedure in which I have defined an Exception:

childFound EXCEPTION;

and the exception block looks like this

EXCEPTION
WHEN childFound THEN
RAISE_APPLICATION_ERROR(-20001,'DELETE CHILD FIRST');

I would like to display just the message 'DELETE CHILD FIRST'. But when I try to get the message it displays as follows:

ORA-20001: DELETE CHILD FIRST
ORA-06512: at "QUALITY.PKG_QUALITY_CHECK_SUMMARY", line 445
ORA-06512: at line 1

Can someone help me with this?

Cheers,
Srini
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-27-2007
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,860
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: How to get RAISE_APPLICATION_ERROR message alone?

That is the nature of the sub routine. It will display error number with the error message.
If you want only the error message not the number then use DBMS_OUTPUT.PUT_LINE instead of RAISE_APPLICATION_ERROR.
Reply With Quote
  #3 (permalink)  
Old 06-30-2009
Junior Member
 
Join Date: Jun 2009
Location: Broomfield, CO, USA
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
troydba is on a distinguished road
Re: How to get RAISE_APPLICATION_ERROR message alone?

Actually, you can use the optional third parameter to do what you want:

"To call RAISE_APPLICATION_ERROR, use the syntax

raise_application_error(error_number, message[, {TRUE | FALSE}]);

where error_number is a negative integer in the range -20000 .. -20999 and message is a character string up to 2048 bytes long. If the optional third parameter is TRUE, the error is placed on the stack of previous errors. If the parameter is FALSE (the default), the error replaces all previous errors. RAISE_APPLICATION_ERROR is part of package DBMS_STANDARD, and as with package STANDARD, you do not need to qualify references to it."

So..try calling RAISE_APPLICATION_ERROR once with TRUE and once with FALSE as the third parameter and see if it does what you want...
Reply With Quote
Reply

  Geeks Talk > Databases > Oracle

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
mozilla alert message reet_dhiman Windows 1 11-29-2007 10:32 PM
How to capture text from message/error popup window Geek_Guest WinRunner 0 04-03-2007 02:25 PM
Send message to cellphone from PC Geek_Guest VB.NET 0 02-26-2007 09:01 PM
Out of memory message while exporting Corporate Docs Geek_Guest Data Warehousing 0 02-19-2007 05:34 AM


All times are GMT -4. The time now is 06:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved