MQeFieldsDataLength

Description
Return the number of elements in a field, in units of the field's data type, or '-1' on error.

Syntax
#include <hmq.h> 
#include <hmqHelper.h> 
MQEINT32 MQeFieldsDataLength(MQEHSESS hSess, 
											MQEHFIELDS hFlds, 
											MQECHAR * pName, 
               						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.

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
  • On success, returns the number of elements in the field.
  • On failure, returns '-1'.

Pseudo-code
MQEINT32 MQeFieldsDataLength( hSess, 
											hFlds, 
											pName, 
											pCompCode, 
											pReason) {
  MQEBYTE datatype=0;
  MQEINT32 datalen;
  datalen = MQeFieldsGet( hSess, 
									hFlds, 
									pName, 
									&datatype, 
									NULL, 0, 
									NULL, 
              				pCompCode, 
									pReason);
  return datalen;
}

See Also
MQeFieldsGet


© IBM Corporation 2002. All Rights Reserved