Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error escalating

Status
Not open for further replies.

krzyzowiec

Programmer
Nov 9, 2000
5
0
0
US
Can a trigger sitting on a table raise a FORM_TRIGGER_FAILURE? If not, how can one display an error message sent from a trigger to the application user?
 
Since you mention FORM_TRIGGER_FAILURE I assume you are refering to Oracle Forms. If you need to raise an application error from a server side trigger use the oracle provided procedure RAISE_APPLICATION_ERROR.

If your server side trigger fails, I would assume Forms would fail as well, but this way you can catch the exception and handle it gracefully.

Good Luck,

Bob Bob Lowell
ljspop@yahoo.com

 
Thanks for your help. I did use the RAISE_APPLICATION_ERROR procedure and when a trigger fails a popup window shows some error message but I've got a feeling that a user can ignore it and proceed. What I need is a significant error message for a user. The ideal solution would be to stop the application the same way it would be stopped by the RAISE_TRIGGER_FAILURE procedure. I do not use a custom form. What I've got is an ORACLE built form I'm not supposed to modify. This is why I ran into this problem.
 
You may catch this database error either in excption handler of calling pl/sql block or in on-error trigger. Just check your specific sqlcode and provide message or alert with your 'significant error message for a user'.
 
sem, I was told to not change form's code. My trigger does not belong to the application. It's on a server side. When it fails an application displays a message but it is not meaningful. I've been looking for a solution to tell the user that there was a problem. I wonder if there is a way to display such a message at all because it would have to be displayed from a trigger sitting on a server and the application runs on a local machine.
 
OK, here's the lateral solution. Your server can broadcast a DBMS_ALERT message to users who have registered an interest in the specific message. You can then use the message which gets sent to your client as a var to pass to an error message handler on the client... etc., etc.,
 
Thanks, I tried this one, too. This is a great tool; however, in order to use it with Oracle Apps, I would have to change the form code by adding DBMS_ALERT.WAITONE procedure to catch the alert message but, as I mentioned before, I cannot touch it.
 
In some cases after receiving Forms' error message user may get more specific information with display_error built-in. Though it displays all error stack, the message text from raise_application_error also can be seen. Normally it's called by Shift+F1 but shortcut may be changed in terminal file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top