swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

mq-inquire

 
 

Library: Interfaces, MQSeries access (OMMQI)
Include: ommqi.xin

Declaration

  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

object
is an IBM MQSeries mq-object representing a previously opened queue.
sels
is a shelf of integers representing all the attributes to be retrieved.
integers
is a modifiable integer shelf that will contain all the integer values specified in the selector shelf.
strings
is a modifiable stream shelf that will contain all the string values specified in the selector shelf.


Purpose

Use mq-inquire to inquire about various attributes of the opened object.

Requirements

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).

Usage Notes

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.

Example

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

    Related Syntax
   mq-set
   mq-inquire-names
 
  Other Library Functions
   mq-backout
   mq-close
   mq-commit
   mq-connect
   mq-connection
   mq-connectx
   mq-disconnect
   mq-get
   mq-get-entire-return-status
   mq-get-function-status
   mq-get-logging-level
   mq-get-throw-on-warnings
   mq-inquire
   mq-inquire-names
   mq-object
   mq-open
   mq-put
   mq-put1message
   mq-set
   mq-set-logging-level
   mq-set-throw-on-warnings
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:32 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.