Solved

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

Posted on 2001-08-21
6
397 Views
Last Modified: 2010-08-05
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
0
Comment
Question by:msgsms52
6 Comments
 

Author Comment

by:msgsms52
Comment Utility
Please answer. Its too urgent.
0
 
LVL 2

Expert Comment

by:payperpage
Comment Utility
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
 
LVL 1

Expert Comment

by:EugeneGardner
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:msgsms52
Comment Utility
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
 
LVL 54

Expert Comment

by:nico5038
Comment Utility

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
 

Accepted Solution

by:
modulo earned 0 total points
Comment Utility
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now