DBFFET
DBFFET is the Fetch function of DBCHCL.
DBFFET delivers a pointer to the next parcel of the response.
How It Works
DBFFET performs the following functions:
Submitting a Fetch
The sequence of operations to submit a fetch is:
1 Call DBCHCL for DBFFET
2 Check that return code is zero
Successful Fetch Operation
The sequence of operations for a successful fetch operation is:
1 Call DBCHCL for DBFFET
2 Check that return code is zero
3 If in Move Mode, check that Fetch Error Indicator is zero
If in Parcel Mode, check that parcel is not Error or Failure parcel and “consume” the information in the parcel
If in Buffer Mode, check that parcel is not Error or Failure parcel and “consume” the information in the parcel
4 Repeat check and “consume” steps for each parcel in buffer
Combination of Modes
There are four combinations of modes for working with the parcels in the response:
The application program can leave the parcels in the response buffer (Locate Mode) and obtain the address of the next parcel (Parcel Mode) each time it calls DBCHCL for DBFFET.
The application program can leave the parcels in the response buffer (Locate Mode) and obtain the address of the whole buffer (Buffer Mode) each time it calls DBCHCL for DBFFET. It is then the application program’s responsibility to separate the parcels, if required.
The application program can have the parcels copied (Move Mode) from the response buffer into the Move area, one parcel (Parcel Mode) each time DBCHCL is called for DBFFET. This method is very convenient for the application program, at the small cost of the extra space for the Move area and the extra time for DBCHCL to copy the parcel.
The application program can have the complete response buffer copied (Move Mode) into the Move area. DBCHCL is called for DBFFET. This method should only be used if the application program must have the complete response buffer copied into its process space. Expect performance to be taxed, because of the extra space for the Move area and the extra time for DBCHCL to copy the parcel.
Interface
The DBFFET interface is as follows:
Function: |
DBFFET - Fetch |
Purpose: |
Fetch next parcel (analogous to SQL ‘FETCH‘) |
Parms: |
|
DBCAREA Parameters
The following fields in the DBCAREA may be read or written to by DBCHCL’s DBFFET, depending on the application program’s environment.