2. OpenAPI Function Reference : OpenAPI Functions : IIapi_formatData() Function--Convert Ingres Data Values to Compatible Types
 
Share this page                  
IIapi_formatData() Function--Convert Ingres Data Values to Compatible Types
The IIapi_formatData() function converts data values between Ingres data types. The data values are translated and formatted using settings selected by the application and specified on an environment handle using IIapi_setEnvParam(). IIapi_convertData() can be used to convert data using default settings selected by the user running the application.
For further details, see the description of IIapi_convertData() (see IIapi_convertData() Function--Convert Ingres Data Values to Compatible Types Using Default Settings).
This function has the following syntax:
II_VOID IIapi_formatData( IIAPI_FORMATPARM *formatParm );
typedef struct _IIAPI_FORMATPARM
{
      II_PTR                     fd_envHandle;
      IIAPI_DESCRIPTOR           fd_srcDesc;
      IIAPI_DATAVALUE            fd_srcValue;
      IIAPI_DESCRIPTOR           fd_dstDesc;
      IIAPI_DATAVALUE            fd_dstValue;
      IIAPI_STATUS               fd_status;
} IIAPI_FORMATPARM;
This function has the following parameters:
fd_envHandle
Type: input
Specifies the environment handle for which the data values to be converted.
fd_srcDesc
Type: input
Specifies the description of the original data type.
fd_srcValue
Type: input
Specifies the original data value. The value must not be NULL.
fd_dstDesc
Type: input
Specifies the description of the desired result data type.
fd_dstValue
Type: output
Specifies the resulting data value. There must be enough memory allocated to hold the resulting data value as described by fd_dstDesc (that is, dv_length must be equal or greater than ds_length).
fd_status
Type: output
Returns IIAPI_ST_SUCCESS if the conversion succeeded. Returns IIAPI_ST_FAILURE if there is an invalid parameter value, insufficient space to hold the resulting data value, or the input data value could not be converted to the requested type.