Press "Enter" to skip to content

On-Select trigger in Oracle D2k

On-Select trigger in Oracle D2k

Description
Fires when Form Builder would normally execute the open cursor, parse, and execute phases of a query,
to identify the records in the database that match the current query criteria.
Definition Level form or block
Legal Commands

SELECT statements, PL/SQL, unrestricted built-ins
Enter Query Mode no
Usage Notes
Use an On-Select trigger to open and execute the database cursor. Specifically, use this trigger when
you are retrieving data from a non-ORACLE data source. The On-Select trigger can be used in
conjunction with the On-Fetch trigger to replace the processing that normally occurs in the
EXECUTE_QUERY built-in subprogram.
To perform the default Form Builder processing from this trigger, include a call to the
SELECT_RECORDS built-in.
On Failure
no effect
Fires In
EXECUTE_QUERY
Open The Query
See Process Flowcharts
On-Select trigger examples
Example
In the following example, the On-Select trigger is used to call a user exit, ’Query,’ and a built-in
subprogram, SELECT_RECORDS, to perform a query against a database.
IF Get_Application_Property(DATASOURCE) = ’DB2’ THEN
User_Exit ( ’Query’ );
IF Form_Failure OR Form_Fatal THEN
ABORT_QUERY;
END IF;
ELSE
/*
** Perform the default Form Builder task of opening the
query.
*/
Select_Records;
END IF;