mqAddInquiry

The mqAddInquiry call can be used with administration bags only; it is specifically for administration purposes.

The mqAddInquiry call adds a selector to an administration bag. The selector refers to an IBM MQ object attribute that is to be returned by a PCF INQUIRE command. The value of the Selector parameter specified on this call is added to the end of the bag, as the value of a data item that has the selector value MQIACF_INQUIRY.


Syntax for mqAddInquiry

    mqAddInquiry (Bag, Selector, CompCode, Reason)


Parameters for mqAddInquiry

    Bag (MQHBAG) - input
    Bag handle.

    The bag must be an administration bag; that is, it must have been created with the MQCBO_ADMIN_BAG option on the mqCreateBag call. If the bag was not created this way, MQRC_BAG_WRONG_TYPE results.

    Selector (MQLONG) - input
    Selector of the IBM MQ object attribute that is to be returned by the appropriate INQUIRE administration command.

    CompCode (MQLONG) - output
    Completion code.

    Reason (MQLONG) - output
    Reason code qualifying CompCode. The following reason codes indicate error conditions that can be returned from the mqAddInquiry call:

      MQRC_BAG_WRONG_TYPE
      Wrong type of bag for intended use.

      MQRC_HBAG_ERROR
      Bag handle not valid.

      MQRC_SELECTOR_OUT_OF_RANGE
      Selector not within valid range for call.

      MQRC_STORAGE_NOT_AVAILABLE
      Insufficient storage available.

      MQRC_SYSTEM_BAG_NOT_ALTERABLE
      System bag cannot be altered or deleted.


Usage notes for mqAddInquiry

  1. When the administration message is generated, the MQAI constructs an integer list with the MQIACF_*_ATTRS or MQIACH_*_ATTRS selector that is appropriate to the Command value specified on the mqExecute, mqPutBag, or mqBagToBuffer call. It then adds the values of the attribute selectors specified by the mqAddInquiry call.
  2. If the Command value specified on the mqExecute, mqPutBag, or mqBagToBuffer call is not recognized by the MQAI, MQRC_INQUIRY_COMMAND_ERROR results. Instead of using the mqAddInquiry call, this can be overcome by using the mqAddInteger call with the appropriate MQIACF_*_ATTRS or MQIACH_*_ATTRS selector and the ItemValue parameter of the selector being inquired.


C language invocation for mqAddInquiry

mqAddInquiry (Bag, Selector, &CompCode, &Reason);
Declare the parameters as follows:
MQHBAG   Bag;           /* Bag handle */
MQLONG   Selector;      /* Selector */
MQLONG   CompCode;      /* Completion code */
MQLONG   Reason;        /* Reason code qualifying CompCode */


Visual Basic invocation for mqAddInquiry

(Supported on Windows only.)

mqAddInquiry Bag, Selector, CompCode, Reason
Declare the parameters as follows:
Dim Bag      As Long 'Bag handle'
Dim Selector As Long 'Selector'
Dim CompCode As Long 'Completion code'
Dim Reason   As Long 'Reason code qualifying CompCode'


Supported INQUIRE command codes

  • MQCMD_INQUIRE_AUTH_INFO
  • MQCMD_INQUIRE_AUTH_RECS
  • MQCMD_INQUIRE_AUTH_SERVICE
  • MQCMD_INQUIRE_CHANNEL
  • MQCMD_INQUIRE_CHANNEL_STATUS
  • MQCMD_INQUIRE_CLUSTER_Q_MGR
  • MQCMD_INQUIRE_CONNECTION
  • MQCMD_INQUIRE_LISTENER
  • MQCMD_INQUIRE_LISTENER_STATUS
  • MQCMD_INQUIRE_NAMELIST
  • MQCMD_INQUIRE_PROCESS
  • MQCMD_INQUIRE_Q
  • MQCMD_INQUIRE_Q_MGR
  • MQCMD_INQUIRE_Q_MGR_STATUS
  • MQCMD_INQUIRE_Q_STATUS
  • MQCMD_INQUIRE_SECURITY

For an example that demonstrates the use of supported INQUIRE command codes, see Inquiring about queues and printing information (amqsailq.c).

Parent topic: MQAI calls