Errors Caused by Oracle Database Triggers in Forms ....

Hello,
I had some database triggers written in Oracle Database. I want to give customized messages based on database trigger in Forms. I know using dbms_error_text and dbms_error_code , we can control some ORA errors but it is not working in case of user defined errors in database triggers.
Can anyone suggest some solution to this problem?
I am using release 2.1 of D2K with Oracle 8i.

Thanks in Advance.
Shafeeq
msgsms52Asked:
Who is Participating?
 
moduloConnect With a Mentor Commented:
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0
 
msgsms52Author Commented:
Please answer. Its too urgent.
0
 
payperpageCommented:
One approach I can think of is to stop errors happening in the triggers:

In each piece of trigger code have an EXCEPTION block that traps any errors, writes them to a table, and sets a flag.  That way, your form can check the flag, and if it is set, go look the error up in the table instead of waiting for the default behaviour of the error code beinge passed back from the trigger.

Is this sort of method appropriate?  I am not the greatest PL/SQL expert, but I would always prefer to use EXCEPTION handlers at the lowest possible level, as the behaviour is then more predictable.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
EugeneGardnerCommented:
I'm not very clear that I understand your question, but it seems that you may find the RAISE_APPLICATION_ERROR built in does what you need.  You can put this in your database trigger and have it cause Oracle to error with your choice of text.  e.g.

IF <some_condition> then
   RAISE_APPLICATION_ERROR(-20011,'Shaafeq is a hero');
END IF;

If this isn't any help then please spell out the problem more precicely with examples.
0
 
msgsms52Author Commented:
Hi All,
I found the solution to the said problem. One can use an available parameter to trap error generated by Database Level triggers.
This parameter is dbms_error_code and it throws the error code thrown by Oracle RDBMS.
We can use it in On_Error trigger in forms while providing this control of database level error messages.

Thanks and Best Regards.
Shafeeq
0
 
nico5038Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.