FetchIntoRecord method: Business Interlink class

Syntax

FetchIntoRecord(RECORD.recname, [, {user_process_inst | user_operid}])

Description

The FetchIntoRecord method copies the data from the output buffer into the specified record (SQL table) copying like-named fields. This method assumes that the names of the fields in the record match the names of the outputs defined in the Business Interlink definition.

You can use the FetchIntoRecord method to perform a transaction on a large amount of data that you want to receive from your system. Instead of executing your Business Interlink and then fetching one output row at a time, you might execute your Business Interlink, then use the FetchIntoRecord method to write the data returned from the Business Interlink to a staging table.

Note:

Before you use this method, you should flush the record used for output and remove any residual data that might exist in it.

If your data is hierarchical, that is, in a rowset, and you want to preserve the hierarchy, use FetchIntoRowset instead of this method.

To order your output rows, you must add the BI_SEQ_NUM column to the record.

This column is populated with a sequence number that corresponds to the order in which each row of the record was written to by the method.

Parameters

Parameter Description

RECORD. recname

Specify a record (SQL table) that you want to populate with data from the output buffers.

user_process_inst | user_operid

This is an optional parameter that enables either different Application Engine programs or different clients to populate the same RECORD. outputrecname at the same time.

For user_process_inst, the parameter takes an integer.RECORD. outputrecname must have a PROCESS_INSTANCE field. The PROCESS_INSTANCE field is used to identify the Application Engine program that is using this Business Interlink. You can use the %PROCESS_INSTANCE variable to populate user_process_inst.

For user_operid, the parameter takes a string.RECORD. outputrecname must have an OPERID field. The OPERID field is used to identify the client who is using this Business Interlink. You can use the %OPERID variable to populate user_operid.

Returns

Number of rows fetched if one or more non-empty rows are returned.

If an empty row is returned, that is, every if field is empty except the return_status and return_status_msg fields, this method returns one of the following error messages:

Number Meaning

0

No error

1

NoInterfaceObject

2

ParamCountError

3

IncorrectParameterType

4

NoColumnForOutputParm

5

NoColumnForInputParm

6

BulkInsertStartFailed

7

BulkInsertStopFailed

8

CouldNotCreateSelectCursor

9

CouldNotCreateInsertCursor

10

CouldNotDestroySelectCursor

11

CouldNotDestroyInsertCursor

12

InputRecordDoesNotExist

13

OutputRecordDoesNotExist

14

ContainEmptyRow

15

SQLExecError

201

FieldTooLarge

202

IgnoreSignNumber

203

ConvertFloatToInt

Example

&RSLT = &QE_SM_CONCAT.FetchIntoRecord(RECORD.PERSONAL__VENDR_DATA);
If &RSLT = 0 Then 
/* no rows fetched */ 
Else 
   /* do processing */ 
End-If;