How To Use FETCH_RECORDS In Oracle Forms

When called from an On-Fetch trigger, initiates the default Form Builder processing for fetching records
that have been identified by SELECT processing.

FETCH_RECORDS examples
/*
** Built-in: FETCH_RECORDS
** Example: Perform Form Builder record fetch processing
during
** query time. 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. The block property RECORDS_TO_FETCH
** allows you to know how many records Form Builder
** is expecting.
** trigger: On-Fetch
*/
DECLARE
numrecs NUMBER;
BEGIN
/*
** Check the global flag we set during form startup
*/
IF :Global.Using_Transactional_Triggers = ’TRUE’ THEN
/*
** How many records is the form expecting us to
** fetch?
*/
numrecs := Get_Block_Property(’EMP’,RECORDS_TO_FETCH);
/*
** Call user exit to determine if there are any
** more records to fetch from its cursor. User Exit
** will return failure if there are no more
** records to fetch.
*/
User_Exit(’my_fetch block=EMP remaining_records’);
/*
** If there ARE more records, then loop thru
** and create/populate the proper number of queried
** records. If there are no more records, we drop through
** and do nothing. Form Builder takes this as a signal that
** we are done.
*/
IF Form_Success THEN
/* Create and Populate ’numrecs’ records */
FOR j IN 1..numrecs LOOP
Create_Queried_Record;
/*
** User exit returns false if there are no more
** records left to fetch. We break out of the
** if we’ve hit the last record.
*/
User_Exit(’my_fetch block=EMP get_next_record’);
IF NOT Form_Success THEN
EXIT;
END IF;
END LOOP;
END IF;
/*
** Otherwise, do the right thing.
*/
ELSE
Fetch_Records;
END IF;
END;

时间: 2024-08-06 13:57:47

How To Use FETCH_RECORDS In Oracle Forms的相关文章

Displaying Window In Center In Oracle Forms 6i

Center window automatically  in Oracle Forms 6i, use the following procedure by passing window name as parameter: Example PROCEDURE auto_centre (pwn in varchar2) ISvw number := get_window_property(forms_mdi_window, width);vh number := get_window_prop

Writing On-Error Trigger In Oracle Forms

Suppose you want to handle an error in oracle forms and want to display custom error message for that error, but also you want to customize more for a particular error. For example there are many fields in form with required property is set to TRUE f

Giving Data Backup Option in Oracle Forms 6i

Suppose you want to give the data backup option in Oracle Forms application to some client users, where you have installed Oracle 11g client or direct from server. The following procedure executes a batch file placed in current working directory of t

How To Use DBLink In Oracle Forms 6i

You want to connect multiple databases in oracle forms to perform certain tasks, for example you need to execute ddl or dml statements against databases but when you try to use dblink it gives you error or suddenly quits from the oracle forms. Soluti

An Example of On-Error Trigger in Oracle Forms

I wrote this trigger around 4 years ago to handle errors in an application based on Oracle Forms 6i. This trigger handles all errors with some custom messages for some specific errors and not only this after giving an appropriate message to the user

Moving From Top To Bottom in Detailed Block in Oracle Forms

Suppose you want to scan a tabular grid block (loop through all records in detail block) from top to bottom in Oracle forms. You can do this task by using :system.last_record system variable to determine whether it is last record in a block and then

Determining Current Block and Current Item in Oracle Forms

SYSTEM.CURSOR_BLOCK Determining current block in Oracle Forms Using SYSTEM.CURSOR_BLOCK system variable. The value that the SYSTEM.CURSOR_BLOCK system variable represents depends on the current navigation unit:If the current navigation unit is the bl

Number To Indian Rupee Words in Oracle Forms / Reports

Convert numbers to Indian Rupees format in Oracle Forms / Reports. Create the below mention function in Oracle Forms / Reports and call it with passing a number parameter. FUNCTION INR_words( p_number In number, vFrDec varchar2 Default 'Paisa Only')

Adding List Item Element At Runtime In Oracle Forms

Add combo list / drop down list item element at runtime in Oracle forms. Syntax PROCEDURE ADD_LIST_ELEMENT(list_name VARCHAR2,list_index, NUMBERlist_label VARCHAR2,list_value NUMBER); Example Declare  nElmntCount Number;Begin   -- First count the tot