2. OpenAPI Function Reference : OpenAPI Functions : IIapi_getDescriptor() Function—Communicate Format of Return Data with IIapi_getColumns()
 
Share this page                  
IIapi_getDescriptor() Function—Communicate Format of Return Data with IIapi_getColumns()
The IIapi_getDescriptor() function retrieves information from the server about the format of the data being returned to the application. This information includes the number of columns in a row and the type, length, precision, and scale of each column. The actual values are returned with a subsequent call to IIapi_getColumns().
IIapi_getDescriptor() output remains valid until the query is ended with the IIapi_close() function.
This function has the following syntax:
II_VOID IIapi_getDescriptor (IIAPI_GETDESCRPARM *getDescrParm);
typedef struct _IIAPI_GETDESCRPARM
{
      IIAPI_GENPARM       gd_genParm;
      II_PTR              gd_stmtHandle;
      II_LONG             gd_descriptorCount;
      IIAPI_DESCRIPTOR   *gd_descriptor;
} IIAPI_GETDESCRPARM;
This function has the following parameters:
gd_genParm
Type: input and delayed output
Specifies the generic parameters. For a description, see Generic Parameters).
gd_stmtHandle
Type: input
Specifies the statement handle identifying the query or event handle identifying the database event.
gd_descriptorCount
Type: delayed output
Specifies the number of columns being returned. This parameter is 0 if there is no data that meets the criteria of the query.
gd_descriptor
Type: delayed output
Specifies an array of buffers. The number of buffers is equal to the gd_descriptorCount value. Each buffer contains the description of a column, including information about the data type, length, precision, and scale.
The memory for this parameter is managed by OpenAPI. For more information, see Output Parameters Allocated by OpenAPI).