11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FETCH_RECORDS built-in<br />

Description<br />

When called from an On-Fetch trigger, initiates the default <strong>Form</strong> <strong>Builder</strong> processing for fetching records<br />

that have been identified by SELECT processing.<br />

Syntax<br />

PROCEDURE FETCH_RECORDS;<br />

Built-in Type unrestricted procedure<br />

Enter Query Mode no<br />

This built-in is included primarily for applications that will run against a non-ORACLE data source.<br />

Parameters<br />

none<br />

FETCH_RECORDS examples<br />

/*<br />

** Built-in: FETCH_RECORDS<br />

** Example: Perform <strong>Form</strong> <strong>Builder</strong> record fetch processing<br />

during<br />

** query time. Decide whether to use this built-in<br />

** or a user exit based on a global flag setup at<br />

** startup by the form, perhaps based on a<br />

** parameter. The block property RECORDS_TO_FETCH<br />

** allows you to know how many records <strong>Form</strong> <strong>Builder</strong><br />

** is expecting.<br />

** trigger: On-Fetch<br />

*/<br />

DECLARE<br />

numrecs NUMBER;<br />

BEGIN<br />

/*<br />

** Check the global flag we set during form startup<br />

*/<br />

IF :Global.Using_Transactional_Triggers = ’TRUE’ THEN<br />

/*<br />

** How many records is the form expecting us to<br />

** fetch?<br />

*/<br />

numrecs := Get_Block_Property(’EMP’,RECORDS_TO_FETCH);<br />

/*<br />

** Call user exit to determine if there are any<br />

** more records to fetch from its cursor. User Exit<br />

** will return failure if there are no more<br />

** records to fetch.<br />

*/<br />

User_Exit(’my_fetch block=EMP remaining_records’);<br />

/*<br />

** If there ARE more records, then loop thru<br />

** and create/populate the proper number of queried<br />

** records. If there are no more records, we drop through<br />

** and do nothing. <strong>Form</strong> <strong>Builder</strong> takes this as a signal that<br />

119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!