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. |
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 ...
|
|||||||
| 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. |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
| Sponsored Links |
|
|||
|
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. |
|
|||
|
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... |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |