2. OpenAPI Function Reference : OpenAPI Functions : IIapi_convertData() Function—Convert Ingres Data Values to Compatible Types Using Default Settings
 
Share this page                  
IIapi_convertData() Function—Convert Ingres Data Values to Compatible Types Using Default Settings
The IIapi_convertData() function converts data values between Ingres data types. The data values are translated and formatted using default settings selected by the user and specified at the operating system level prior to running the application. IIapi_formatData() can be used to convert data using settings selected by the application.
This function is intended to support Ingres data types that do not have a corresponding C language data type.
Conversions to and from IIAPI_CHA_TYPE are supported for the data types IIAPI_DEC_TYPE, IIAPI_MNY_TYPE, IIAPI_DTE_TYPE, IIAPI_DATE_TYPE, IIAPI_TIME_TYPE, IIAPI_TMWO_TYPE, IIAPI_TMTZ_TYPE, IIAPI_TS_TYPE, IIAPI_TSWO_TYPE, IIAPI_TSTZ_TYPE, IIAPI_INTYM_TYPE, IIAPI_INTDS_TYPE.
In addition, the following conversions are supported:
Data Type
Converted To
IIAPI_DEC_TYPE
IIAPI_FLT_TYPE
IIAPI_FLT_TYPE
IIAPI_DEC_TYPE
IIAPI_MNY_TYPE
IIAPI_FLT_TYPE
IIAPI_FLT_TYPE
IIAPI_MNY_TYPE
The source data value must not be NULL (that is, dv_null set to TRUE).
This function has the following syntax:
II_VOID IIapi_convertData(IIAPI_CONVERTPARM *convertParm);
typedef struct _IIAPI_CONVERTPARM
{
      IIAPI_DESCRIPTOR      cv_srcDesc;
      IIAPI_DATAVALUE       cv_srcValue;
      IIAPI_DESCRIPTOR      cv_dstDesc;
      IIAPI_DATAVALUE       cv_dstValue;
      IIAPI_STATUS          cv_status;
} IIAPI_CONVERTPARM;
This function has the following parameters:
cv_srcDesc
Type: input
Specifies a description of the original data type.
cv_srcValue
Type: input
Specifies the original data value. This value must not be NULL.
cv_dstDesc
Type: input
Specifies the description of the desired result data type.
cv_dstValue
Type: output
Specifies the resulting data value. There must be enough memory allocated to hold the resulting data value, as described by cv_dstDesc (that is, dv_length must be equal or greater than ds_length).
cv_status
Type: output
Returns IIAPI_ST_SUCCESS if the conversion succeeded; 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.