11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EXECUTE_TRIGGER built-in<br />

Description<br />

EXECUTE_TRIGGER executes an indicated trigger.<br />

Syntax<br />

PROCEDURE EXECUTE_TRIGGER<br />

(trigger_name VARCHAR2);<br />

Built-in Type restricted procedure (if the user-defined trigger calls any restricted built-in subprograms)<br />

Enter Query Mode yes<br />

Note: EXECUTE_TRIGGER is not the preferred method for executing a user-named trigger: writing a<br />

user-named subprogram is the preferred method.<br />

Parameters<br />

trigger_name Specifies the name of a valid user-named trigger.<br />

Usage Notes<br />

Because you cannot specify scope for this built-in, <strong>Form</strong> <strong>Builder</strong> always looks for the trigger starting at<br />

the lowest level, then working up.<br />

To execute a built-in associated with a key, use the DO_KEY built-in instead of EXECUTE_TRIGGER.<br />

For example, rather than:<br />

Execute_trigger (’KEY-NEXT-ITEM’);<br />

Use instead:<br />

Do_Key(’NEXT_ITEM’);<br />

EXECUTE_TRIGGER restrictions<br />

Although you can use EXECUTE_TRIGGER to execute a built-in trigger as well as a user-named<br />

trigger, this usage is not recommended, because the default fail behavior follows a different rule than<br />

when invoked automatically by <strong>Form</strong> <strong>Builder</strong> as part of default processing. For example, in default<br />

processing, if the When-Validate-Item trigger fails, it raises an exception and stops the processing of the<br />

form. However, if the When-Validate-Item trigger fails when it is invoked by EXECUTE_TRIGGER,<br />

that failure does not stop the processing of the form, but only sets <strong>Form</strong>_Failure to FALSE on return<br />

from the EXECUTE_TRIGGER built-in.<br />

EXECUTE_TRIGGER examples<br />

/*<br />

** Built-in: EXECUTE_TRIGGER<br />

** Example: Execute a trigger dynamically from the PL/SQL<br />

** code of a Menu item, depending on a menu<br />

** checkbox.<br />

*/<br />

DECLARE<br />

Cur_Setting VARCHAR2(5);<br />

115

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!