#include <hmq.h> MQEINT32 MQeFieldsPut( MQEHSESS hSess, MQEHFIELDS hFlds, MQECHAR * pName, MQEBYTE DataType, MQEVOID * pData, MQEINT32 nElements, MQEINT32 * pCompCode, MQEINT32 * pReason)
If DataType is MQE_TYPE_FIELDS, pData must not be null.
pName | DataType | DataLen | Data | Comment |
---|---|---|---|---|
! null | * | >0 | ! null | Normal usage |
! null | * | >0 | null | Preallocate a field data. |
null | * | * | * | Error |
#include <hmq.h> static MQECHAR const * FieldsType = "com.ibm.mqe.MQeFields"; MQEHSESS hSess; MQEHFIELDS hFlds; MQEBYTE datatype; MQEINT32 n; MQEINT32 data; MQEINT32 compcode; MQEINT32 reason; MQEINT32 rc; hSess = MQeInitialize("MyAppsName", &compcode, &reason); hFlds = MQeFieldsAlloc( hSess, FieldsType, &compcode, &reason); /* Put a 4-bytes integer into the fields object. */ datatype = MQE_TYPE_INT; n = 1; data = 0x12345678; rc = MQeFieldsPut( hSess, hFlds, "MyData", datatype, (MQEBYTE *) &data, n, &compcode, &reason);