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. 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. 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
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. 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. 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. 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. Running a Form In Debug Mode
Forms
Debugger
Window
Run Form Debug
14. Debug Triggers and Breakpoint
Every
statement
Debugger
Program Unit
Statement
Statement
Statement
Debug
trigger
Breakpoint
trigger
Fire
Fire
Fire
Breakpoint
16. Summary
• Creating Trigger
• From Built-ins
• Restricted and Unrestricted built-ins
• When-Button-Pressed trigger
• When-Window-Closed Trigger
Notes de l'éditeur
Note:
You can use DEFAULT_VALUE built-in to declare global variables.
Example: DEFAULT_VALUE( ‘HYDERABAD’,’GLOBAL.city’ );
You can use ERASE Built-in to remove global variables. Globals always allocate 255 bytes of storage.
To ensure that performance is not impacted more than necessary, always erase any global variable
When it is no longer required.
Note:
Break points must be attached to an executable statement in the body of the
Code. Comments lines or NULL commands are not valid for this purpose.