Optim Data Privacy Providers  11.3.0
 All Data Structures Files Functions Variables Macros Groups Pages
Structure Members
DP_FIELD_DEF Struct Reference

#include <ODPPCmnAPI.h>

Collaboration diagram for DP_FIELD_DEF:
Collaboration graph

Structure Members

struct DP_FIELD_DEFpNext
 
char cEyeCatcher [4]
 
short sStructVer
 
short sStructLen
 
short sDatatype
 
int iLength
 
int iPrecision
 
short sScale
 
int iDataCodePage
 
char cDataDBMSType
 
int iColNameBytes
 
char cSubType
 
DPFD_WC_SSpWC
 
DPFD_MC_SSpMC
 

Structure Description

Structure Member Documentation

struct DP_FIELD_DEF* pNext
  • Use:
    This member is used to point to the next column.
  • Description:
    This is a pointer to the next element in the chain of DP_FIELD_DEF structures. Each column is represented by a DP_FIELD_DEF structure instance and multiple columns must be chained together using this member.

    Example:
    DP_SVC_DEF SvcDef; //Service Definition structure
    DP_FIELD_DEF *pFldDef; //DP_FIELD_DEF structure pointer
    memset(&SvcDef, 0, sizeof(DP_SVC_DEF)); //Clear the Service Definition
    pFldDef = (DP_FIELD_DEF *) malloc(sizeof(DP_FIELD_DEF)); //Allocate memory for the first column definition
    if(NULL == pFldDef) //Check if memory was allocated successfully
    {
    printf("Failed to allocate memory for first column definition");
    return ODPPFAILURE;
    }
    memset(pFldDef, 0, sizeof(DP_FIELD_DEF)); //Clear the allocated memory for the Field Define
    pFldDef->sDatatype = ODPPDATATYPE_INTEGER; //Set the data type for the first column
    pFldDef->pNext = (DP_FIELD_DEF *) malloc(sizeof(DP_FIELD_DEF)); //Allocate memory for the second column definition
    if(NULL == pFldDef->pNext) //Check if memory was allocated successfully
    {
    printf("Failed to allocate memory for second column definition");
    free(pFldDef);
    return ODPPFAILURE;
    }
    memset(pFldDef->pNext, 0, sizeof(DP_FIELD_DEF)); //Clear the allocated memory for the Field Define
    pFldDef->pNext->sDatatype = ODPPDATATYPE_USMALLINT; //Set the data type for the second column
    SvcDef.pFldDef = pFldDef; //Copy pointer to the chain of DP_FIELD_DEF structures to the Service Definition
    SvcDef.sFldCount = 2; //Set the Field count to 2 since two columns are being supplied.

    [Alternate method of sending multiple columns]
    ODPP also provides an alternate method of sending multiple columns as an ARRAY. The user can declare an array of DP_FIELD_DEF structures where each element will represent a single column. When using this method it is mandatory to set member #sFldCount of parent structure DP_SVC_DEF equal to the number of elements in the DP_FIELD_DEF array.

    Example:
    DP_SVC_DEF SvcDef; //Service Definition structure
    DP_FIELD_DEF FldDef[MAX_COLUMNS]; //Array of DP_FIELD_DEF structures. Assume MAX_COLUMNS is 2.
    memset(&SvcDef, 0, sizeof(DP_SVC_DEF)); //Clear the Service Definition
    memset(FldDef, 0, MAX_COLUMNS * sizeof(DP_FIELD_DEF)); //Clear the Field Define area
    FldDef[0].sDatatype = ODPPDATATYPE_INTEGER; //Set the data type for the first column
    FldDef[1].sDatatype = ODPPDATATYPE_USMALLINT; //Set the data type for the second column
    SvcDef.pFldDef = &FldDef[0]; //Copy pointer to the first DP_FIELD_DEF structure to the Service Definition
    SvcDef.sFldCount = 2; //Set the Field count to 2 since two columns are being supplied.
  • Optional:
    N/A
char cEyeCatcher[4]
  • Use:
    For Internal use only.
  • Description:
    This is commonly used as structure identifier, specially helpful during debugging, and is set using INITIALIZE_ODPP_STRUCT_PTR to Initialize the structure instance.
  • Optional:
    N/A
short sStructVer
  • Use:
    For Internal use only.
  • Description:
    This is commonly used to hold structure version, specially helpful during debugging, and is set using INITIALIZE_ODPP_STRUCT_PTR to Initialize the structure instance.
  • Optional:
    N/A
short sStructLen
  • Use:
    [FOR FUTURE USE]
  • Description:
    [FOR FUTURE USE]
  • Optional:
    [FOR FUTURE USE]
short sDatatype
  • Use:
    This member is used to specify the data type of the current column.
  • Description:
    This is a 2 byte integer which specifies the data type of the input data. This data type is required for the conversion of the data passed/returned using structure DP_FIELD_DATA_DEF. This value must be set to a valid ODPP Data Type.

    See Also
    ODPP Data Types

  • Optional:
    No
int iLength
  • Use:
    This member is used to specify the length of the current column for string data types only.
  • Description:
    This is an integer which specifies the length of the column for string data types. Although length is optional for most of the Service Providers, it is recommended for Hash and Lookup Data Privacy Service Providers to allocate internal data buffers. If iLength is not specified, the Hash and Lookup Service Provider will use a maximum buffer size of 4096 bytes for each column. If iLength is specified, ensure that it is equal to or greater than the maximum data buffer size set in member #iSrcBufLen or #iDstBufLen of structure DP_FIELD_DATA_DEF.

    It is highly recommended to set iLength equal to or greater than the maximum data buffer size to ensure that only required memory is allocated by the Service Provider.
  • Optional:
    Yes, but is recommended for Hash and Lookup Service Providers.
int iPrecision
  • Use:
    This member is used to specify the precision of the current column.
  • Description:
    This is an integer which specifies the precision of the numeric column.
short sScale
  • Use:
    This member is used to specify the scale of the current column.
  • Description:
    This is a 2 byte integer which specifies the scale of the numeric column.
int iDataCodePage
  • Use:
    This member is used to specify the code page of the data.
  • Description:
    This member is used to specify the code page of the data.
  • Optional:
    No
char cDataDBMSType
  • Use:
    This member is used to specify the DBMS type.
  • Description:
    For data coming from a database like Column Names, parameter values etc., then this member is used to specify the DBMS type of the control data for the corresponding code page.
  • Optional:
    No
int iColNameBytes
  • Use:
    This member is used to specify the size of column name buffer, #pColName, in bytes.
  • Description:
    This is an integer which represents the maximum size of the column name buffer used to supply current column name in bytes.
  • Optional:
    No
char cSubType
  • Use:
    This member is used to specify if column name is expressed in wide character (Unicode) format or mixed character (MBCS/SBCS) format.
  • Description:
    This member is used to specify the type of sub-structure for representing column name. DP_FIELD_DEF structure has two sub-structures DPFD_WC_SS (for supplying column name in wide character (Unicode) format) and #DPFD_MC_S (for supplying column name in mixed character (MBCS/SBCS) format)


    It can hold following values:
    • W/0/blank :
      To use DPFD_WC_SS structure for specifying column name in wide character (Unicode) format. pWC member is used to point to the wide character structure DPFD_WC_SS.
    • M :
      To use DPFD_MC_SS structure for specifying column name in mixed character (SBCS/MBCS) format. pMC member is used to point to the mixed character structure DPFD_MC_SS.
  • Optional:
    No
DPFD_WC_SS* pWC
  • Use:
    This member is used to specify column name for the current column in wide character (Unicode) format and is mutually exclusive with member pMC.
  • Description:
    This is a pointer to the DPFD_WC_SS structure which is used to represents the column name in wide character (Unicode) format. To use this structure cSubType must be set to either 'W', 0, BLANK. If this member is used to specify column name then you can not use pMC.
  • Optional:
    No
DPFD_MC_SS* pMC
  • Use:
    This member is used to specify column name for the current column in mixed character (SBCS/MBCS) format and is mutually exclusive with member pWC.
  • Description:
    This is a pointer to the DPFD_MC_SS structure which is used to represents the current column name expressed in mixed character (SBCS/MBCS) format, DBMS type of the column name and Code Page of the column name. To use this structure cSubType must be set to 'M'. If this member is used to specify column name then you can not use pWC.
  • Optional:
    No