REPLY_INQUIRY_MESSAGES scalar function
The REPLY_INQUIRY_MESSAGES scalar function replies to one or more inquiry messages in the QSYSOPR message queue.
This function extends what can be done by the Send Reply (SNDRPY) CL command.
Authorization: See Note below.
- message-id
- A character string containing the message identifier of the inquiry message. The special value *IMMED can be specified to indicate the message has no message identifier.
- search-message-text
- A character string containing a string that must exist in the message text in order for the inquiry message to be selected. The comparison is case insensitive.
- response
- A character string containing the response to be provided to any inquiry messages that meet the message-id and search-string criteria.
- remove-message
- A character string that indicates whether the inquiry message and its reply are removed from the
message queue.
- NO
- The message will not be removed.
- YES
- The message will be removed. This is the default.
Note
This function is provided in the SYSTOOLS schema as an example of how to respond to inquiry messages in the QSYSOPR message queue using an SQL scalar function. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.
Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.
Examples
- Respond to any inquiry messages for message identifier CPA7025. Leave the messages in the
message queue.
VALUES SYSTOOLS.REPLY_INQUIRY_MESSAGES( MESSAGE_ID => 'CPA7025', RESPONSE => 'I', REMOVE_MESSAGE => 'NO' );
- Respond to any impromptu inquiry messages containing the text string
'restore'.
VALUES SYSTOOLS.REPLY_INQUIRY_MESSAGES( MESSAGE_ID => '*IMMED' SEARCH_MESSAGE_TEXT => 'restore', RESPONSE => 'CONTINUE', REMOVE_MESSAGE => 'YES' );