MQReadClob() function
The MQReadClob() function returns a message as a CLOB from WMQ without removing the message from the queue.
Syntax
- service_name
- Optional parameter. Refers to the value in the servicename column of the "informix".mqiservice table. If service_name is not specified, IDS.DEFAULT.SERVICE is used as the service. The maximum size of service_name is 48 bytes.
- policy_name
- Optional parameter. Refers to the value in the policyname column of the "informix".mqipolicy table. If policy_name is not specified, IDS.DEFAULT.POLICY is used as the policy. The maximum size of policy_name is 48 bytes.
- correl_id
- Optional parameter. A string containing a correlation identifier to be associated with this message. The correl_id is often specified in request and reply scenarios to associate requests with replies. The maximum size of correl_id is 24 bytes. If not specified, no correlation ID is added to the message.
Usage
The MQReadClob() function returns a message as a CLOB from the WMQ location specified by service_name, using the quality-of-service policy defined in policy_name. This function does not remove the message from the queue associated with service_name. If correl_id is specified, then the first message with a matching correlation ID is returned. If correl_id is not specified, then the message at the head of the queue is returned. The result of this function is a CLOB type. If no messages are available to be returned, this function returns NULL. This function only reads committed messages.
Usage | Argument interpretation |
---|---|
MQReadClob() | No arguments |
MQReadClob(arg1) | arg1 = service_name |
MQReadClob(arg1, arg2) | arg1 = service_name arg2 = policy_name |
MQReadClob(arg1, arg2, arg3) | arg1 = service_name arg2 = policy_name arg3 = correl_id |
Return codes
- The contents of the message as a CLOB
- The operation was successful. If no messages are available, the result is NULL.
- Error
- The operation was unsuccessful.
Example
begin;
EXECUTE FUNCTION MQReadClob();
commit;
insert into my_order_table(clob_col) VALUES(MQReadClob());
- service_name: default service name
- policy_name: default policy name
- correl_id: None
begin;
EXECUTE FUNCTION MQReadClob('MYSERVICE');
rollback;
insert into my_order_table(clob_col)
VALUES(MQReadClob('MYSERVICE'));
- service_name: "MYSERVICE"
- policy_name: default policy name
- correl_id: None
begin;
EXECUTE FUNCTION MQReadClob('MYSERVICE','MYPOLICY');
commit;
insert into my_order_table(clob_col)
VALUES(MQReadClob('MYSERVICE', 'MYPOLICY'));
- service_name: "MYSERVICE"
- policy_name: "MYPOLICY"
- correl_id: None
begin;
EXECUTE FUNCTION MQReadClob('MYSERVICE','MYPOLICY', 'TESTS');
commit;
insert into my_order_table(clob_col)
VALUES(MQReadClob('MYSERVICE', 'MYPOLICY', 'TESTS'));
- service_name: "MYSERVICE"
- policy_name: "MYPOLICY"
- correl_id: "TESTS"