mqInquireItemInfo
The mqInquireItemInfo call returns information about a specified item in a bag. The data item can be a user item or a system item.
Syntax for mqInquireItemInfo
- mqInquireItemInfo (Bag, Selector, ItemIndex, ItemType, OutSelector, CompCode, Reason)
Parameters for mqInquireItemInfo
- Bag (MQHBAG) - input
- Handle of the bag to be inquired.
The bag can be a user bag or a system bag.
- Selector (MQLONG) - input
- Selector identifying the item to be inquired.
If the selector is less than zero (that is, a system selector), the selector must be one that is supported by the MQAI; MQRC_SELECTOR_NOT_SUPPORTED results if it is not.
The specified selector must be present in the bag; MQRC_SELECTOR_NOT_PRESENT results if it is not.
The following special values can be specified for Selector:- MQSEL_ANY_SELECTOR
- The item to be inquired is a user or system item identified by the ItemIndex parameter.
- MQSEL_ANY_USER_SELECTOR
- The item to be inquired is a user item identified by the ItemIndex parameter.
- MQSEL_ANY_SYSTEM_SELECTOR
- The item to be inquired is a system item identified by the ItemIndex parameter.
- ItemIndex (MQLONG) - input
- Index of the data item to be inquired. The item must be present within the bag;
MQRC_INDEX_NOT_PRESENT results if it is not. The value must be zero or greater, or the following
special value:
- MQIND_NONE
- This specifies that there must be one occurrence only of the selector in the bag. If there is
more than one occurrence, MQRC_SELECTOR_NOT_UNIQUE results.
If MQSEL_ANY_SELECTOR is specified for the Selector parameter, the ItemIndex parameter is the index relative to the set of items that contains both user items and system items, and must be zero or greater.
If MQSEL_ANY_USER_SELECTOR is specified for the Selector parameter, the ItemIndex parameter is the index relative to the set of system items, and must be zero or greater.
If MQSEL_ANY_SYSTEM_SELECTOR is specified for the Selector parameter, the ItemIndex parameter is the index relative to the set of system items, and must be zero or greater. If an explicit selector value is specified, the ItemIndex parameter is the index relative to the set of items that have that selector value and can be MQIND_NONE, zero, or greater.
- ItemType (MQLONG) - output
- The data type of the specified data item. The following can be returned:
- MQITEM_BAG
- Bag handle item.
- MQITEM_BYTE_STRING
- Byte string.
- MQITEM_INTEGER
- Integer item.
- MQITEM_INTEGER_FILTER
- Integer filter.
- MQITEM_INTEGER64
- 64-bit integer item.
- MQITEM_STRING
- Character-string item.
- MQITEM_STRING_FILTER
- String filter.
- OutSelector (MQLONG) - output
- Selector of the specified data item.
- CompCode (MQLONG) - output
- Completion code.
- Reason (MQLONG) - output
- Reason code qualifying CompCode.
The following
reason codes indicating error conditions can be returned from the mqInquireItemInfo call:
- MQRC_HBAG_ERROR
- Bag handle not valid.
- MQRC_INDEX_ERROR
- MQIND_NONE specified with one of the MQSEL_ANY_XXX_SELECTOR values.
- MQRC_INDEX_NOT_PRESENT
- No item with the specified index is present within the bag for the selector given.
- MQRC_ITEM_TYPE_ERROR
- ItemType parameter not valid (invalid parameter address).
- MQRC_OUT_SELECTOR_ERROR
- OutSelector parameter not valid (invalid parameter address).
- MQRC_SELECTOR_NOT_PRESENT
- No item with the specified selector is present within the bag.
- MQRC_SELECTOR_NOT_SUPPORTED
- Specified system selector not supported by the MQAI.
- MQRC_SELECTOR_NOT_UNIQUE
- MQIND_NONE specified when more than one occurrence of the specified selector is present in the bag.
- MQRC_SELECTOR_OUT_OF_RANGE
- Selector not within valid range for call.
- MQRC_STORAGE_NOT_AVAILABLE
- Insufficient storage available.
C language invocation for mqInquireItemInfo
mqInquireItemInfo (Bag, Selector, ItemIndex, &OutSelector, &ItemType, &CompCode, &Reason);Declare the parameters as follows:
MQHBAG Bag; /* Bag handle */ MQLONG Selector; /* Selector identifying item */ MQLONG ItemIndex; /* Index of data item */ MQLONG OutSelector; /* Selector of specified data item */ MQLONG ItemType; /* Data type of data item */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying CompCode */
Visual Basic invocation for mqInquireItemInfo
(Supported on Windows only.)
mqInquireItemInfo Bag, Selector, ItemIndex, OutSelector, ItemType, CompCode, ReasonDeclare the parameters as follows:
Dim Bag As Long 'Bag handle' Dim Selector As Long 'Selector identifying item' Dim ItemIndex As Long 'Index of data item' Dim OutSelector As Long 'Selector of specified data item' Dim ItemType As Long 'Data type of data item' Dim CompCode As Long 'Completion code' Dim Reason As Long 'Reason code qualifying CompCode'Parent topic: MQAI calls