MQREADCLOB
The MQREADCLOB function returns a message from a specified MQSeries® location without removing the message from the queue.
>>-MQREADCLOB(-+----------------------------------------+-)---->< '-receive-service--+-------------------+-' '-,--service-policy-'
The schema is DB2MQ.
The MQREADCLOB function returns a message from the MQSeries location that is specified by receive-service, using the quality-of-service policy that is defined in service-policy. Performing this operation does not remove the message from the queue that is associated with receive-service, but instead returns the message at the beginning of the queue.
- receive-service
- An expression that returns a value that is a built-in character string or graphic string data
type that is not a LOB. The value of the expression must not be an empty string or a string with
trailing blanks. The expression must have an actual length that is no greater than 48 bytes. The
value of the expression must refer to a service point that is defined in the DB2MQ.MQSERVICE table.
A service point is a logical end-point from which a message is sent or received. A service point
definition includes the name of the MQSeries queue
manager and the name of the queue. See MQSeries
Application Messaging Interface for more details.
If receive-service is not specified or is the null value, DB2.DEFAULT.POLICY is used.
- service-policy
- An expression that returns a value that is a built-in character string or graphic string data
type that is not a LOB. The value of the expression must not be an empty string or a string with
trailing blanks. The expression must have an actual length that is no greater than 48 bytes. The
value of the expression must refer to a service policy that is defined in the DB2MQ.MQPOLICY table.
A service policy specifies a set of quality-of-service options that are to be applied to this
messaging operation. These options include message priority and message persistence. See MQSeries Application Messaging Interface for more
details.
If service-policy is not specified or is the null value, DB2.DEFAULT.POLICY is used.
The result of the function is a CLOB with a length attribute of 1 MB. The result can be null. If no messages are available to be returned, the result is the null value.
The CCSID of the result is the system CCSID that was in effect at the time that the MQSeries function was installed into DB2®.
SELECT MQREADCLOB()
FROM SYSIBM.SYSDUMMY1;
The message at the beginning
of the queue specified by the default service and using the default
policy is returned as a CLOB. SELECT MQREADCLOB('MYSERVICE')
FROM SYSIBM.SYSDUMMY1;
The message at the beginning
of the queue specified by MYSERVICE and using the default policy is
returned as a CLOB. SELECT MQREADCLOB('MYSERVICE','MYPOLICY')
FROM SYSIBM.SYSDUMMY1;
The message
at the beginning of the queue specified by MYSERVICE and using the
policy MYPOLICY is returned as a CLOB.