MQSendClob() function
The MQSendClob() function puts the CLOB data into the WMQ 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.
- clob_data
- Required parameter. The CLOB data to be sent to WMQ. Even though the CLOB data size can be up to 4 TB, the maximum size of the message is limited by what Websphere MQ supports. If clob_data is NULL, it sends a zero-length message to the queue.
- 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 MQSendClob() function puts the data contained in clob_data to the WMQ queue specified by service_name, using the quality of service policy defined by policy_name. If correl_id is specified, then the message is sent with a correlation identifier. If correl_id is not specified, then no correlation ID is sent with the message.
The
following table describes how the arguments for the MQSendClob() function
are interpreted.
Usage | Argument interpretation |
---|---|
MQSendClob(arg1) | arg1 = clob_data |
MQSendClob(arg1, arg2) | arg1 = service_name arg2 = clob_data |
MQSendClob(arg1, arg2, arg3) | arg1 = service_name arg2 = policy_name arg3 = clob_data |
MQSendClob(arg1, arg2, arg3, arg4) | arg1 = service_name arg2 = policy_name arg3 = clob_data arg4 = correl_id |
Return codes
- 1
- The operation was successful.
- 0 or Error
- The operation was unsuccessful.
Examples
Example 1
begin;
EXECUTE FUNCTION MQSendClob(filetoclob("/work/mydata", "client"));
commit;
This example sends a CLOB to the WMQ with
the following parameters:
- service_name: default service name
- policy_name: default policy
- clob_data: filetoclob("/work/mydata", "client")
- correl_id: none
Example 2
begin;
EXECUTE FUNCTION MQSendClob('MYSERVICE', filetoclob("/work/mydata", "client"));
commit;
This example sends a CLOB to the WMQ with
the following parameters:
- service_name: "MYSERVICE"
- policy_name: default policy
- msg_data: filetoclob("/work/mydata", "client")
- correl_id: none
Example 3
begin;
EXECUTE FUNCTION MQSendClob('MYSERVICE', 'MYPOLICY',
filetoclob("/work/mydata", "client"));
commit;
This example sends a CLOB to the WMQ with
the following parameters:
- service_name: "MYSERVICE"
- policy_name: "MYPOLICY"
- msg_data: filetoclob("/work/mydata", "client")
- correl_id: none
Example 4
begin;
EXECUTE FUNCTION MQSendClob('MYSERVICE', 'MYPOLICY',
filetoclob("/work/mydata", "client"), 'TEST3');
commit;
This example sends a CLOB to the WMQ with
the following parameters:
- service_name: "MYSERVICE"
- policy_name: "MYPOLICY"
- msg_data: filetoclob("/work/mydata", "client")
- correl_id: "TEST3"