Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Oracle Forms: create debug triggers

2,379 views

Published on

Oracle Forms: create debug triggers

Published in: Software
  • Be the first to comment

  • Be the first to like this

Oracle Forms: create debug triggers

  1. 1. Creating & Debugging Triggers
  2. 2. Objectives • How to Create Triggers? • Writing trigger code • Describe Built-in sub-programs used in Forms • When-Button-Pressed Trigger • When-Window-Closed Trigger • Debugging Triggers
  3. 3. How to Create a Trigger?
  4. 4. Trigger PL/SQL Block • DECLARE ------- Declarative statements (OPTIONAL) • BEGIN ------- Executable statements (MANDATORY) • EXCEPTION --------- Exception Handling. (OPTIONAL) • END;
  5. 5. Variables in Form Builder • PL/SQL variables must be declared in triggers or must be defined in a package • Form Builder variables not required to be declared – Requires a Colon Prefix
  6. 6. Form Builder Variables • Items For presentation and user interaction :block_name.item_name • Global variables Session-wide character variable :GLOBAL.var_name • System variables Form status and control :SYSTEM.var_name • Parameters Passing values in and out of module :PARAMENTER.parameter
  7. 7. Form Builder Built-in Subprograms Built-ins belong to either: • The Standard Extensions package where no prefix is required • Another Form Builder package where a prefix is required Built-in Restricted Built-ins Unrestricted Built-ins Allowed only In certain Triggers Allowed In Any Trigger or subprogram
  8. 8. Built-in Subprograms • EDIT_TEXTITEM • ENTER_QUERY • EXECUTE_QUERY • EXIT_FORM • GO_BLOCK • GO_ ITEM • NEXT_RECORD • PREVIOUS_RECORD • MESSAGE • SHOW_ALERT • SHOW_ EDITOR • SHOW_ LOV • SHOW_VIEW • HIDE_VIEW • GET_ITEM_PROPERTY • SET_ITEM_PROPERTY
  9. 9. When-Button-Pressed Trigger • Fires when the operator clicks a button. • Accepts restricted and unrestricted built-ins. • Used for existing form, Display LOVs, Editors etc. Example GO_BLOCK(‘EMP’); EXECUTE_QUERY;
  10. 10. When-Window-Closed Trigger • Fires when the operator closes a window by clicking button. • Accepts restricted and unrestricted built-ins. • Used to programmatically close a window when the operator issues a window manager-specific close command. You can close a window by using built-ins. When-Window-Closed Trigger at Form Level. EXIT_FORM;
  11. 11. Debugging Triggers • Monitor and Debug Triggers by: – Compiling and rectifying errors in the PL/SQL Editor – Displaying debug messages at run time – Invoking the PL/SQL Debugger
  12. 12. Debugging Triggers -Tips • Connect to Database before compiling SQL statements. • Define triggers always at the correct level • Terminate statements with semicolon where ever necessary. • Watch for missing quotation marks • Place the triggers where the event will happen.
  13. 13. Running a Form In Debug Mode Forms Debugger Window Run Form Debug
  14. 14. Debug Triggers and Breakpoint Every statement Debugger Program Unit Statement Statement Statement Debug trigger Breakpoint trigger Fire Fire Fire Breakpoint
  15. 15. PL/SQL Debugger Step Into Step Over Step Out Go Reset Debug Commands
  16. 16. Summary • Creating Trigger • From Built-ins • Restricted and Unrestricted built-ins • When-Button-Pressed trigger • When-Window-Closed Trigger

×