6 29 LceGetFieldValueX

LANSA Open Guide

6.29 LceGetFieldValueX

Retrieves the value of a field.

BOOL

LceGetFieldValueX

(int

iSession,

 

 

 char far *

strFieldName,

 

 

 char far *

srValue,

 

 

 unsigned long far *

pulFlags )

  

Parameters

iSession

The session identifier as returned by LceGetSessionId.

strFieldName

The field name. The field used in this function must have been declared using an LceUseField function.

strValue

The buffer location for the returned value. The field value is stored here once the function has executed successfully. The size should be at least the length of the data + 1. The data length may be obtained using LceGetFieldDataLength. The maximum field size is RDMLX_FIELD_DATA_SIZE as defined in the LCOE.H header file.

pulFlags

Identifies the returned value as *SQLNULL. If the field has a value of *SQNULL pulFlags will return 1 otherwise it will return 0.

  

Return Values

TRUE is returned if the session has got the field value.

FALSE is returned if an error occurs.

Notes

This function uses string parameters. Even if the field you are getting is numeric or date/time, it will contain a string value representing the respective numeric or date/time value. You will need to convert the string value to a numeric or date/time before using it in your application. This conversion should be done using the facilities provided with your development toolset. If none are provided, refer for example to the LceASCIIToFloat and LceASCIIToInteger functions.

If this function is used for Unicode fields, only characters that can be displayed in the current codepage will be translated correctly. Characters which cannot be translated will appear as question marks ("?"). To avoid this restriction use LceGetFieldValueU.

  • This function may be executed at any time after the session is opened.
  • This function performs no communications to the host.

Related Functions

6.30 LceGetFieldValueU

6.58 LceSetFieldValue

6.59 LceSetFieldValueU

6.20 LceGetFieldDataLength