In an On-Count trigger, performs the default Oracle Forms processing for identifying the number of rows that a query will retrieve for the current block, and clears the current block. If there are changes to commit in the block, Oracle Forms prompts the end user to commit them during COUNT_QUERY processing. Oracle Forms returns the following message as a result of a valid call to COUNT_QUERY:
FRM-40355: Query will retrieve <number> records.This Built-in is included primarily for applications that will run against a non-ORACLE data source.
PROCEDURE COUNT_QUERY;
Built-in Type restricted procedure
Enter Query Mode yes
none
Valid only in triggers that allow restricted Built-ins.
/*
** Built-in: COUNT_QUERY
** Example: Display the number of records that will be retrieved
** by the current query.
*/
BEGIN
Count_Query;
END;
Example 2
/*
** Built-in: COUNT_QUERY
** Example: Perform Oracle Forms count query hits processing.
** Decide whether to use this Built-in or a user
** exit based on a global flag setup at startup by
** the form, perhaps based on a parameter.
** Trigger: On-Count
*/
BEGIN
/*
** Check the global flag we set during form startup
*/
IF :Global.Using_Transactional_Triggers = 'TRUE' THEN
/*
** User exit returns query hits count back into the
** CONTROL.HITS item.
*/
User_Exit('my_count');
/*
** Deposit the number of query hits in the appropriate
** block property so Oracle Forms can display its normal
** status message.
*/
Set_Block_Property(:System.Trigger_Block,QUERY_HITS,
:control.hits);
/*
** Otherwise, do the right thing.
*/
ELSE
Count_Query;
END IF;
END;