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...

Sunday, March 18, 2012

FRM-40735:ON-ERROR trigger raised unhandled exception ORA-06508

After converting older version of oracle forms to forms 10g using forms Migration Assistant, you are not be able to open the application or log in to the application via web. When access from developer suit 10g, it will run without any problems. One of the problem could be the related ORACLE LIBRARY PATH which attached to it. Some times this can happens when you are changing the library path according to the module or work area you work at that moment.


In older versions of forms the library path is mapped to the client pc and the forms application refer to the mapped drive letter. In the web we couldn't find specific path. It is relative. It will automatically refer the path.


If you have above mentioned problem, you will get message from oracle form builder. It says cannot attache specific libraries to your form source. Sometimes you wont get this message but wont be able to open the form. when you look in to the form source in form builder, you will see that form didn't include any library. 


There's few solution available for this matter. 

  • Open the form in Oracle form builder. Click on Attached library and plus sign item on Object Navigator.  Locate the need .plls and press YES on the message which ask whether to remove path or not.
  • Go to the regedit through Command Prompt. Go to forms_path if you are  working with 10g2 , otherwise go to forms90_path and enter the related library path to that.
  • Go to the Oracle folder where installed it in your computer and go to the forms folder if you are using oracle 10g2. Otherwise go to forms90 folder. In that folder, go in to the server folder and you can find ENV file named Default. open it on notepad or wordpad. It includes something like "FORMS_PATH" if you are using 10g2. Otherwise "FORMS90_PATH" give the related library to that path and save it. Now whole forms is under your control. 
Now you can open the form and access via web successfully. 


Additional....

  • Don't use long paths for Library folder.
  • Keep the latest libraries which are in SVN.
  • Always replace the regedit path and default.env path when you are changing the module or oracle version accordingly.
  • Oracle 10g1 use FORMS90 AND Oracle 10g2 use FORMS.