A script-enabled browser is required for this page to function properly.

EXECUTE_TRIGGER Built-in

Description

EXECUTE_TRIGGER executes an indicated trigger.

Syntax

PROCEDURE EXECUTE_TRIGGER
(trigger_name VARCHAR2);

Built-in Type restricted procedure (if the user-defined trigger calls any restricted Built-in subprograms)

Enter Query Mode yes

Note: EXECUTE_TRIGGER is not the preferred method for executing a user-named trigger: writing a user-named subprogram is the preferred method.

Parameters

trigger_name Specifies the name of a valid user-named trigger.

Usage Notes

Because you cannot specify scope for this Built-in, Oracle Forms always looks for the trigger starting at the lowest level, then working up.

To execute a Built-in associated with a key, use the DO_KEY Built-in instead of EXECUTE_TRIGGER. For example, rather than:

Execute_Trigger ('KEY-NEXT-ITEM');

Use instead:

Do_Key('NEXT_ITEM');

EXECUTE_TRIGGER Restrictions

Although you can use EXECUTE_TRIGGER to execute a Built-in trigger as well as a user-named trigger, this usage is not recommended, because the default fail behavior follows a different rule than when invoked automatically by Oracle Forms as part of default processing. For example, in default processing, if the When-Validate-Item trigger fails, it raises an exception and stops the processing of the form. However, if the When-Validate-Item trigger fails when it is invoked by EXECUTE_TRIGGER, that failure does not stop the processing of the form, but only sets Form_Failure to FALSE on return from the EXECUTE_TRIGGER Built-in.

EXECUTE_TRIGGER Example

/*

** Built-in: EXECUTE_TRIGGER
** Example: Execute a trigger dynamically from the PL/SQL
** code of a Menu item, depending on a menu
** checkbox.
*/
DECLARE
Cur_Setting VARCHAR2(5);
Advanced_Mode BOOLEAN;
BEGIN
/*
** Check whether the 'Advanced' menu item under the
** 'Preferences' submenu is checked on or not.
*/
Cur_Setting := GET_MENU_ITEM_PROPERTY
('Preferences.Advanced',CHECKED);
/*
** If it is checked on, then Advanced_Mode is boolean
** true.
*/
Advanced_Mode := (Cur_Setting = 'TRUE');
/*
** Run the appropriate trigger from the underlying form
**
*/
IF Advanced_Mode THEN
EXECUTE_TRIGGER('Launch_Advanced_Help');
ELSE
EXECUTE_TRIGGER('Launch_Beginner_Help');
END IF;
END;