|
|||||
|
||||||
Related Syntax | Other Library Functions |
function |
mq-inquire |
Library: MQSeries access (OMMQI) legacy
Include: ommqi.xin |
define external function mq-inquire object value mq-object object selectors read-only integer sels integer-vals modifiable integer integers optional string-vals modifiable stream strings optional
Argument definitions
Use mq-inquire to inquire about various attributes of the opened object.
You must include the following line at the beginning of your OmniMark
program:
include "ommqi.xin"
The MQSeries queue represented by object must be open (else external exception OMMQI0013).
There must be at least one selector specified on the selector shelf (else external exception OMMQI0020).
The selector shelf must not contain MQCA_NAMES (else external exception OMMQI0019). See mq-inquire-names
.
The correct shelves must be passed for the selectors provided. For example, if an integer selector is passed then the integer shelf must be provided in the function call (else external exception OMMQI0021).
This function corresponds with the IBM MQSeries function MQINQ. See the IBM MQSeries documentation for MQINQ for more information.
The Hconn parameter in the IBM MQSeries C interface is not in the OmniMark MQSeries interface as it is tracked by the object parameter.
The integers and strings parameters encapsulate the integer and string array parameters in the MQINQ function
The CompCode and Reason parameters of MQINQ are integrated into the OMMQI error handling,
The string selector MQCA_NAMES is not valid for this call. It is necessary to instead use the mq-inquire-names function call to gather the MQCA_NAMES attribute.
Inquire about and display both string and integer attributes.
do local mq-connection a-connection local mq-object a-object local stream od-fields variable local mq-object-descriptor a-mqod local integer the-selectors variable local integer int-attribs variable local stream str-attribs variable ; connect to queue manager called "default-queue-manager" set a-connection to mq-connect to "default-queue-manager" ; set up mq-object-descriptor to work on default queue set new od-fields {"ObjectName"} to "default" mq-set-object-descriptor a-mqod to od-fields ; open the queue (inquire open options must be set) set a-object to mq-open connection a-connection object-descriptor a-mqod options MQOO_INQUIRE set new the-selectors to MQCA_Q_NAME set new the-selectors to MQIA_CURRENT_Q_DEPTH set new the-selectors to MQIA_MAX_Q_DEPTH set new the-selectors to MQCA_XMIT_Q_NAME ; inquire mq-inquire object a-object selectors the-selectors integer-vals int-attribs string-vals str-attribs output "Integer attributes" repeat over int-attribs output "Attribute ID " || key of int-attribs || " : Value = " || "d" % int-attribs || "%n" again output "String attributes" repeat over str-attribs output "Attribute ID " || key of str-attribs || " : Value = '" || str-attribs || "'%n" again
Copyright © Stilo International plc, 1988-2008.