Retrieving a "clean" dbms_error_text message in on-error trigger

From: Eric Givler <egivler_at_flash.net>
Date: Sat, 18 Nov 2000 15:18:46 GMT
Message-ID: <q5xR5.4109$6W1.332565_at_news.flash.net>


"Clean" capture of DBMS Error messages on raise_application_error

This is with Forms 4.5 Developer 1.3.2 (32bit)

Has anyone written forms level triggers, I guess ON-ERROR triggers to properly capture the error messages raised from a database trigger or procedure that uses a RAISE_APPLICATION_ERROR?

I'd like to display the SAME message that I'm passing to RAISE application error, the message only, without all the other garbage.

I was thinking of capturing the dbms_error_code and dbms_error_text, and then based on the form error code - kind of like in the example code in the Forms Help. Then, I'd parse these strings and strip off my error message, because the dbms_error_text contains the entire "error stack", ie:

ORA-20100: SEASON DATES ERROR! Reservations exist in this date range
ORA-06512: at "SUNTRACK.SEASON_DATES_BR_D", line 19
ORA-04088: error during execution of trigger 'SUNTRACK.SEASON_DATES_BR_D'

So... I'd like to just get "SEASON DATES ERROR! Reservations exist in this date range" message

Questions:
1. Is there an easy way to do this that I'm missing, or do I have to brute force, look for 'ORA'||dbms_error_code||': ' in my dbms_error_text, strip that off the front, and then grab the error text up to the first LINEFEED, chr(10), found in the dbms_error_text - that just seems a little "kludgy"

2. Anyone have a nice solution? IT seems like there should be a "standard" on-error trigger that handles this type of situation.

3. What would be all the form errors that I should look for that could have been the result of an error raised in a trigger??? ie. frm-40509 (unable to update), frm-40510 (unable to delete) Received on Sat Nov 18 2000 - 16:18:46 CET

Original text of this message