Returns the number of records Oracle Forms expects an On-Fetch trigger to fetch and create as queried records.
You can programmatically examine the value of Records_To_Fetch when you are using transactional triggers to replace default Oracle Forms transaction processing when running against a non-ORACLE data source.
Applies to block
Set not settable
Records_To_Fetch is defined only within the scope of an On-Fetch trigger.
The first time the On-Fetch trigger fires, the value of Records_To_Fetch is either the array size (as specified by the Query Array Size block property) or the number of records displayed + 1, whichever is larger.
If the On-Fetch trigger creates this many queried records, the next time the On-Fetch trigger fires, the value of Records_To_Fetch will be the same number.
If, however, the On-Fetch trigger creates fewer records than the value of Records_To_Fetch and returns without raising Form_Trigger_Failure, Oracle Forms will fire the On-Fetch trigger again. Records_To_Fetch will be the set to its previous value minus the number of queried records created by the previous firing of the On-Fetch trigger.
This behavior continues until one of the following events occurs:
/*
** Call a client-side package function to retrieve
** the proper number of rows from a package cursor.
*/
DECLARE
j NUMBER := Get_Block_Property(blk_name, RECORDS_TO_FETCH);
emprow emp%ROWTYPE;
BEGIN
FOR ctr IN 1..j LOOP
/* Try to get the next row.*/
EXIT WHEN NOT MyPackage.Get_Next_Row(emprow);
Create_Queried_Record;
:Emp.rowid := emprow.ROWID;
:Emp.empno := emprow.EMPNO;
:Emp.ename := emprow.ENAME;
:
:
END LOOP;
END;