Pre-query Trigger in Oracle d2k/oracle Forms

Source: Internet
Author: User
Tags switches

Pre-query Trigger in Oracle d2k/oracle Forms Description
Fires during Execute query or Count Query processing, just before Form Builder constructs and issues
The SELECT statement to identify rows that match the query criteria.
Definition Level form or block
Legal Commands
SELECT statements, unrestricted built-ins
Enter Query Mode No

See Also:define Custom Filter Using pre-query Trigger

Usage Notes
Use a pre-query trigger to modify the example record that determines which rows would be identified by
The query.
On Failure
The query is canceled. If the operator or the application had placed the form in Enter Query mode, the
Form remains in Enter Query mode.
Fires in
Count_query
Execute_query
Open the Query
Prepare the Query
See Process Flowcharts
Pre-query Trigger Examples
Example
This example validates or modifies query criteria for a database block query.
BEGIN
/*
* * Set the ORDER by clause for the current block
* * Being queried, based on a radio group
* * called ' sort_column ' in a control block named
* * ' switches '. The Radio Group has three buttons
* * with character values giving the names of
* * Three different columns in the table this
* * block is based on:
**
* * SAL
* * Mgr,ename
* * ename
*/
Set_block_property (' EMP ', order_by,: Switches.sort_column);
/*
* * Sure the user has given one of the
* * Columns which we have indexed in their search
* * criteria, otherwise fail the query with a helpful
* * Message
*/
IF:Employee.Ename is null AND:EMPLOYEE.MGR was null then
Message (' Supply Employee Name and/or Manager Id ' | |
' for Query. ');
RAISE form_trigger_failure;
END IF;
/*
* * Change the default WHERE clause to either show ' current
* * Employees only "or" Terminated Employees "based on the
* * Setting of a check box named ' Show_term ' in a control
* * block named ' switches '.
*/
IF Check box_checked (' switches.show_term ') then
Set_block_property (' EMP ', Default_where, ' term_date is not '
NULL ');
ELSE
Set_block_property (' EMP ', Default_where, ' term_date is NULL ');
END IF;
END;

Pre-query Trigger in Oracle d2k/oracle Forms

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.