MQeFieldsPutArray

Description
Given a name, put an array as individual fields with the field names derived from the name.

Syntax
#include <hmq.h>
MQEVOID MQeFieldsPutArray( MQEHSESS hSess, MQEHFLDS hFlds, 
              MQECHAR* pName, MQEBYTE DataType, MQEVOID * pData, 
              MQEINT32 nElements, MQEINT32 * pCompCode, 
              MQEINT32 * pReason)

Parameters

MQEHSESS hSess - input
The session handle returned by MQeInitialize.

MQEHFIELDS hFlds - input
The handle to an MQeFields object.

MQECHAR * pName - input
A null terminated string name of the field. A null or a zero length string is invalid.

MQEBYTE DataType - input
The data type of the field data. See Field data types. This may not be MQE_TYPE_ASCII or MQE_TYPE_UNICODE as the length of each ascii or unicode string in the array is required. Use MQeFieldsPutAsciiArray or MQeFieldsPutUnicodeArray for these field types.

MQEVOID * pData - input
A data buffer whose size is determined from DataType and nElements .

MQEINT32 nElements - input
Number of elements of type DataType in pData . This must be greater than or equal to 0.

MQEINT32 * pCompCode - output
MQECC_OK, MQECC_WARNING or MQECC_ERROR.

MQEINT32 * pReason - output
If the returned *pCompCode equals MQECC_ERROR, *pReason may have any of the following values:

MQE_EXCEPT_INVALID_HANDLE
If either hSess or hFlds are invalid handles.

MQE_EXCEPT_INVALID_ARGUMENT
If an invalid argument is used.

MQE_EXCEPT_ALLOCATION_FAILED

Return Value
MQEVOID

Example
#include <hmq.h>
static MQECHAR const * FieldsType = "com.ibm.mqe.MQeFields";
MQEHSESS  hSess;
MQEHFIELDS hFlds;
MQEBYTE  datatype;
MQEINT32  n = 5;
MQEINT32  data[5];
MQEINT32  compcode;
MQEINT32  reason;
MQEINT32  rc;
 
hSess  = MQeInitialize("MyAppsName", &compcode, &reason);
hFlds  = MQeFieldsAlloc( hSess, FieldsType, &compcode, &reason);
 
/* Put an array of 32 bit integers into the fields object. */
datatype = MQE_TYPE_INT;
data[0]   = 0x12345678;
data[1]   = 0xFEEDBABE;
data[2]   = 0xCAFEBABE;
data[3]   = 0xCOD1F1ED;
data[4]   = 0x1DEC0DED;
MQeFieldsPutArray( hSess, hFlds, "MyData", datatype, (MQEBYTE *) 
         &data, n, &compcode, &reason);

See Also
MQeFieldsGetArray


© IBM Corporation 2002. All Rights Reserved