MQeFieldsPutByte, MQeFieldsPutShort, MQeFieldsPutInt, MQeFieldsPutLong, MQeFieldsPutFloat, MQeFieldsPutDouble

Description
Puts an 8, 16, 32, or 64 bit integer, float, or double into the MQeFields object.

Syntax
#include <hmq.h> 
#include <hmqHelper.h> 
MQEINT32 MQeFieldsPutByte( MQEHSESS hSess, MQEHFIELDS hFlds, 
             MQECHAR * pName, MQEBYTE* aByte, 
             MQEINT32 * pCompCode, MQEINT32 * pReason) 
 
MQEINT32 MQeFieldsPutShort( MQEHSESS hSess, MQEHFIELDS hFlds, 
              MQECHAR * pName, MQEINT16* int16Val, 
              MQEINT32 * pCompCode, MQEINT32 * pReason) 
 
MQEINT32 MQeFieldsPutInt( MQEHSESS hSess, MQEHFIELDS hFlds, 
             MQECHAR * pName, MQEINT32* anInt, 
             MQEINT32 * pCompCode, MQEINT32 * pReason) 
 
MQEINT32 MQeFieldsPutLong( MQEHSESS hSess, MQEHFIELDS hFlds, 
             MQECHAR * pName, MQEINT64 * pLong, 
             MQEINT32 * pCompCode, MQEINT32 * pReason) 
 
MQEINT32 MQeFieldsPutFloat( MQEHSESS hSess, MQEHFIELDS hFlds, 
              MQECHAR * pName, MQEFLOAT* aFloat, 
              MQEINT32 * pCompCode, MQEINT32 * pReason) 
 
MQEINT32 MQeFieldsPutDouble( MQEHSESS hSess, MQEHFIELDS hFlds, 
              MQECHAR * pName, MQEDOUBLE * pDouble, 
              MQEINT32 * pCompCode, MQEINT32 * pReason)

Parameters

MQEHSESS hSess - input
The session handle, returned by MQeInitialize.

MQEHFIELDS hFlds - input
A handle to an MQeFields object.

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

MQEBYTE * aByte - input
A pointer to a byte value.

MQEINT16 * int16Val - input
A pointer to a 16 bit short integer value.

MQEINT32 *anInt - input
A pointer to a 32 bit integer value.

MQEINT64 * pLong - output
A pointer to a 64 bit integer value.

MQEFLOAT *aFloat - input
A pointer to a float value.

MQEDOUBLE * aDouble - input
A pointer to a double value.

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_NOT_FOUND
Field name not found.

MQE_EXCEPT_INVALID_HANDLE

Return Value

MQEINT32
Returns '0' on success or '-1' on failure.

Example
#include <hmq.h>
#include <hmqHelper.h>
static MQECHAR const * FieldsType = 
			"com.ibm.mqe.MQeFields";
MQEHSESS  hSess;
MQEINT32  compcode;
MQEINT32  reason;
MQEHFIELDS hFlds;
MQEBYTE  byteVal;
MQFLOAT  floatVal;
MQDOUBLE  doubleVal;
MQEINT16  int16Val;
MQEINT32  int32Val;
MQEINT64  int64Val;
MQEINT32  rc;
 
hSess  = MQeInitialize("MyAppsName", 
									&compcode, &reason);
hFlds  = MQeFieldsAlloc( hSess, FieldsType, 
								&compcode, &reason);
 
byteVal = 0x45;
rc    = MQeFieldsPutByte( hSess, hFlds, "b", 
									&byteVal, 
               				&compcode, 
									&reason); 
floatVal  = 2.55;
rc    = MQeFieldsPutFloat( hSess, hFlds, "f", 
									&floatVal, 
               				&compcode, 
									&reason); 
doubleVal = 2.3413453231e-63;
rc    = MQeFieldsPutDouble( hSess, hFlds, "d", 
										&doubleVal, 
               					&compcode, 
										&reason); 
int16Val  = 32000;
rc    = MQeFieldsPutShort( hSess, hFlds, "sh", 
									&int16Val, 
               				&compcode, 
									&reason); 
int32Val  = 2000000000;
rc    = MQeFieldsPutInt( hSess, hFlds, "int", 
									&int32Val, 
              				&compcode, 
									&reason); 
int64Val.hi = 265;
int64Val.lo = 2000000000;
rc    = MQeFieldsPutLong( hSess, hFlds, "lg", 
									&int64Val, 
               				&compcode, 
									&reason); 

See Also


© IBM Corporation 2002. All Rights Reserved