Pages

Monday, March 26, 2012

Raise form_trigger_failure... ORACLE...

Hi Oracle fellows...:)


We all are familiar with the above phrase "Raise Form_Trigger_Failure". This statement is use  freeze the program whenever we need. Freeze means stop the whole process of the oracle program. 
Normally in Oracle forms we use this statement to freeze the form whenever an error occurred. This statement mostly helpful when you are doing higher level validations like QC validations. We can use this statement when we handle an error like prompt appropriate error message. Otherwise program will prompt an appropriate error message and will try to continue the rest of the process according to the program process and code. This will make program to prompt an Oracle error messages for user and he or she will not be able to understand those messages and will get messed up with the program.


Sometimes this statement wont work properly in WHEN_BUTTON_PRESSED trigger. Sometimes this button wont be able to freeze the form and therefore program will try to proceed with the error and will prompt an oracle error. 


This happens sometime when you are using exception handling without proper manner. I mean when trying to prompt out the exception and do nothing to handle it. Actually "Raise Form_Trigger_Failure" is an predefined exception. So in a situation like that, the program will throw you an exception without freezing it.  


For these kind of scenario, we can use above statement as below mentioned.


when form_trigger_failure
Raise Form_Trigger_Failure;


Pretty easy stuff. But you have to put these two lines within the exception handling part. It will work in a nice and smooth manner...

No comments:

Post a Comment