On-error Trigger In Oracle Forms Example
Contents |
Download] -menubig/Softwares Blogger Tips [About Blogging] -grip/Blogger%20tips Contact [Enquiry] Fox Main Menu Oracle Forms gridpost/Oracle%20Forms PL/SQL gridpost/PL%2FSQL Linux/Unix gridpost/Linux%2FUnix Softwares gridpost/Softwares Home Alerts D2k Oracle Forms Triggers Writing On-Error Trigger In Oracle Forms V. Kapoor 8:29 AM A+ how to display error message in oracle forms A- Print Email Suppose you want to handle an error in oracle
Oracle On-error Trigger
forms and want to display custom error message for that error, but also you want to customize more raise form_trigger_failure for a particular error. For example there are many fields in form with required property is set to TRUE for Not Null check. The example below shows the error handling how to display message in oracle forms in oracle forms with a specific Frm-40202 error. On-Error Trigger Trigger Level - Form Declare error_item varchar2(50); curr_item_label varchar2(100); Begin error_item := :system.trigger_item; if error_type = 'FRM' and error_code = 40202 then curr_item_label := get_item_property(error_item, prompt_text); --- you can use alert also to show the message message(curr_item_label || ' cannot be left blank.');
Frm-40735
else message(error_text); --- visual attribute a_errors must exists or create your own set_item_property(error_item, current_record_attribute, 'A_errors'); end if; end; Like us to get notifications for free source code in future, thanks. Ask Your Questions By Comment Below. In case of an error Oracle Forms runtime checks if an On-Error trigger is written at form level. Alerts, D2k, Oracle Forms, Triggers NextNewer Post PreviousOlder Post Post a Comment Subscribe to: Post Comments (Atom) Follow Vinish facebook [2600+]Followers twitter [1500+]Followers google [500+]Followers rss [700+]Followers Lets Be Friends On Google+ E-Book Search This Blog Loading... Topics Blogger tips (22) D2k (89) Free Download (4) Linux/Unix (11) Oracle 12c (6) Oracle DBA (24) Oracle Forms (105) Oracle Forms 12c (4) PL/SQL (57) SQL (56) Popular This Month Using Find_Alert and Show_Alert in Oracle Forms Show_alert is used to display model window messages in Oracle Forms and Find_alert searches the list of valid alerts in Form Builder, when... Display LOV (List Of Values) Using Show_Lov In Oracle Forms Show_Lov Function is used to display list of values (LO
one of the easiest is manipulating the :system.message_level:KEY-COMMIT - trigger on form-level (quick and dirty)BEGIN :System.Message_Level := 25; COMMIT; :System.Message_Level := 5;END;or KEY-COMMIT - triggerDECLARE V_Message_Level NUMBER;BEGIN V_Message_Level := :System.Message_Level; :System.Message_Level := 25; COMMIT; :System.Message_Level := V_Message_Level;END;these are not best practices. Because you have to write those codes in hundreds of procedures and tons of code.Filtering http://www.foxinfotech.in/2013/03/writing-onerror-trigger-oracle-forms.html the errors and messages is the key to have a powerful message-handling. Here is an easy procedure which shows you the technique:ON-ERROR - trigger on form-levelDECLARE V_Error_Code NUMBER; V_Error_Text VARCHAR2 (2000); V_DBMS_Error_Code NUMBER; V_DBMS_Error_Text VARCHAR2 (2000);BEGIN V_Error_Code := Error_Code; V_Error_Text := Error_Text; V_DBMS_Error_Code := DBMS_Error_Code; V_DBMS_Error_Text http://talk2gerd.blogspot.com/2006/12/best-practices-on-error-and-on-message.html := DBMS_Error_Text; IF V_Error_Code IN (40401, 40405) THEN /* || 40401, 40405 - no changes to save / apply get filtered */ NULL; ELSIF V_Error_Code IN (-1034, -3114) THEN /* || -1034, -3114 - not connected to database */ Message ('Not connect to database, exiting Form'); Exit_Form (no_validate); ELSIF V_Error_Code IN (40508, 40735) AND V_DBMS_Error_Code BETWEEN -20999 AND -20000 THEN /* || -20000 errors are raised by RAISE_APPLICATION_ERROR || They are handled in a different way */ Show_and_Log_DB_Error (V_DBMS_Error_Text); ELSE /* || All other errors went into Show_and_Log_Error, where they || get inspected, analyzed and logged. */ Show_and_Log_Error (V_Error_Code); END IF;END; 4 comments: Anonymous said... Hello sir,I tried the same code in on-error trigger in forms but showing me compilation errorthe identifier'Show_and_Log_DB_Error 'and Show_and_Log_Error'must be declared January 16, 2008 Gerd Volberg said... that's correct. Thos
own generated Error [message #336475] Sun, 27 July 2008 12:29 Shaheer Messages: 50Registered: June 2008 Location: Pakistan Member Respected Sir, Please see attached file. In my form one field that takes five digits. for example (00411) and i set its format mask (99-999). When i put less http://www.orafaq.com/forum/t/122480/ then 5 digits in the field, Oracle Form generate its own Error i.e. FRM-40209 Field must http://vambalged2k.blogspot.com/2015/02/on-error-trigger-in-oracle-forms-11g.html be of Form 99"-"999. I also declare my own alert for this error. but First Oracle Form Display its own Error and then my Alert display. i want to display my own alert instead of Oracle Form own generated Error. please post the solution. Attachment: error.GIF (Size: 65.58KB, Downloaded 375 times) [Updated on: Sun, 27 July 2008 12:36]Report message to a moderator in oracle Re: How handle Oracle Form own generated Error [message #336858 is a reply to message #336475] Tue, 29 July 2008 04:22 sasipalarivattom Messages: 118Registered: June 2007 Location: Cochin ( INDIA ) Senior Member Dear Shaheer , Can you please answer these questions? 1. Are you calling the alert in WHEN-VALIDATE-TRIGGER of the Account No field? 2. Do you have any code in on-error trigger to suppress the default error message ? Waiting for your reply. Regards Sasi.. Report message to a in oracle forms moderator Re: How handle Oracle Form own generated Error [message #336914 is a reply to message #336858] Tue, 29 July 2008 06:05 Shaheer Messages: 50Registered: June 2008 Location: Pakistan Member 1) No Sir, i call alert from KEY_NEXT_ITEM trigger. In this trigger i use if condition if (length(:blockname.fieldname) = 5 )then go_item('fieldname'); else i call my own alert; end if; 2) No Sir, i cannot define No_ERROR Trigger. Report message to a moderator Re: How handle Oracle Form own generated Error [message #336917 is a reply to message #336914] Tue, 29 July 2008 06:16 Littlefoot Messages: 20850Registered: June 2005 Location: Croatia, Europe Senior MemberAccount Moderator You "can not" create ON-ERROR trigger, or you "did not" create it? If you didn't, why wouldn't you? There's been an example recently on the board - search for ON-ERROR keyword and you'll even find an example. Report message to a moderator Re: How handle Oracle Form own generated Error [message #336931 is a reply to message #336917] Tue, 29 July 2008 07:05 Shaheer Messages: 50Registered: June 2008 Location: Pakistan Member Respected Sir, how to create ON_ERROR trigger. i want to replace Form own generated Error into my define alert. please post example of ON_ERROR trigger. thanks Report message to a moderator Re: How handle Oracle Form own generated Error [message #336940 is a reply to message #336931] Tue, 29 July 2008 07:29 sa
On-Error Triggger in Form level :- this is common for all form DECLARE BEGIN IF INSTR(DBMS_ERROR_TEXT, 'ORA-') = 1 AND DBMS_ERROR_CODE <> -1403 THEN frmpkg_export.v_backend_err := 'Y'; ELSIF ERROR_CODE = 40401 OR ERROR_CODE = 40102 OR ERROR_CODE = 40405 OR ERROR_CODE = 41051 THEN NULL; ELSE IF DBMS_ERROR_CODE <> 01403 THEN message(ERROR_TEXT); END IF; END IF; END; Email ThisBlogThis!Share to TwitterShare to Facebook ←Newer Post Older Post→ Home 3 comments: Mathew Stephen27 August 2015 at 03:35There are lots of information about oracle have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get to the next level in oracle. Thanks for sharing this.Oracle Training in Chennai | Oracle Course in Chennai | hadoop training in chennaiReplyDeletekovalan Jayamurugan16 October 2015 at 04:32Thanks for your informative article on ios mobile application development. Your article helped me to explore the future of mobile apps developers. Having sound knowledge on mobile application development will help you to float in mobile application development. iOS Training in Chennai | iOS Training Institutes in ChennaiReplyDeleteNikshitha S23 June 2016 at 04:47Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. SAS Training in Chennai | SAS Course in Chennai ReplyDeleteAdd commentLoad more... Subscribe to: Post Comments (Atom) Funny Things to Ponder Copyright © SQL, PL/SQL and ORACLE D2K(FORMS AND REPORTS) collections By Vishal Ambalge | Powered by BloggerDesign by N.Design Studio | Blogger Theme by NewBloggerThemes.com Categories Oracle (16) PL_SQL (12) SQL (3) Popular Posts PL/SQL code for FACTORIAL OF A NUMBER pl/sql program to finding factorial of given number. Procedure: declare i number(4):=1; n number(4):=&n; f... PL/SQL code to check given number is EVEN OR ODD pl/sql program to find given number is even or odd. Procedure: Declare n number(4):=&n; Begin if mod(n,2)=0 then... PL/SQL code for PRIME NUMBER pl/sql program to check weather given number is Prime or not. Procedure: declare num number; i number:=1; c n... PL/SQL code for Reverse Of A Number pl/sql program to generate reverse for given number. Procedure: declare n number(4):=&n; s number(4):=0; r number... PL/SQL Code for Sum of two number To write a pl/