6.53 LceSelect

Select and retrieve specified fields from the file using the key list specified.

BOOL

LceSelect

(int

iSession,

 

 

 char far *

strFieldList,

 

 

 char far *

strFileName,

 

 

 char far *

strKeyList,

 

 

 BOOL

fGeneric,

 

 

 int far *

piRecordCount )

  

Parameters

iSession

The session identifier as returned by LceGetSessionId.

strFieldList

A list of fields to be retrieved from the file. Each of these fields must have been declared using an LceUseField function.

strFileName

The name of the file. This must have been declared using an LceUseFile function.

strKeyList

A list of key field names. These key fields must have been declared using the LceUseField function. The values for the keys are set using the LceSetFieldValue/ LceSetFieldValueU function. Refer to the notes for key and generic search considerations.

fGeneric

Refer to the notes for further information.

True = apply a generic search.

False = do not apply a generic search.

piRecordCount

The number of records returned by the select.

  

Return Values

TRUE is returned if the session has selected records.

FALSE is returned if an error occurs.

Notes

Portability Considerations

An error will occur if you attempt to use a generic key which is numeric if you are using a Windows, Linux or other non-IBM i host system.

  

The characteristic of this LceSelect search can be specified using the LceSetSelectOptions function.

Note: You cannot use the *RECEIVEIMMED option with LceSelect.

This function is a simplified version of these functions:

Instead of calling these three functions, all the records are returned after the one LceSelect call.

In some circumstances the use of LceSelect may not be the best option. If the Host is slow or there are many records to return, then it may be better to use the LceRequestSelect, LceReceiveSelect and LceGetRecordCount functions, as LceRequestSelect returns control to the caller while the host prepares the data. While this is happening, your application can perform other tasks locally.

Key and Generic search considerations:

Related Functions

6.64 LceSetSelectOptions

6.50 LceRequestSelect

6.49 LceReceiveSelect

6.51 LceRequestSelectWhere

6.37 LceGetRecordCount

6.38 LceGetSelect

6.11 LceDeleteSelect