Unanswered: Raise_application_error drop the error number when displaying
I'm raising an error from the dB to an Application like theis RAISE_APPLICATION_ERROR(-20000, 'Contact Support');
the thing is the error printed on screen contains the -20000, is there any way to use this exception and drop the 20000 bit... i've tried user defined and dbms_ouput but neither are captured by the app
What tool did you use to create your application? Mentioning the DBMS_OUTPUT package, I can only suspect that you use it from a command line mode. If not, is it Forms Developer that you used? Something else?
I didn't understand what raises the error. Is it a database trigger on the table (a BEFORE INSERT one, perhaps)? If so, how does it look like? Something like this?
CREATE OR REPLACE TRIGGER trg_test
BEFORE INSERT ON TEST
FOR EACH ROW
RAISE_APPLICATION_ERROR(-20000, 'Contact Support') ;
What you did next was writing a form; assume that it is a simple, default form, written using the Data Block Wizard. When you try to insert a record (save it, actually), you get a message (in the bottom line of the form) saying "FRM-40508: ORACLE error: unable to INSERT record". Now, selecting Help - Display Error reveals what caused it, and now it says "ORA-20000: Contact Support" etc.
What I didn't understand was the way you managed to display ORA-20000 without those additional steps. Did you write a form trigger? Which one? How does it look like? Could you post some extra info (perhaps even a screenshot of the form error)?
I have an error checking function in my dB, that contains the RAISE_APPLICATION_ERROR and in Forms I have the following type code that on button clicked checks for erros in this function first and then displays them.
if Function(error) then