|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Correlation ID problem |
« View previous topic :: View next topic » |
Author |
Message
|
Neinie |
Posted: Wed Oct 01, 2003 6:47 am Post subject: Correlation ID problem |
|
|
Newbie
Joined: 06 Aug 2003 Posts: 7
|
Hi All, im my compute node I am trying to populate msg Correlation Id with part of user data available in msg itself.
Msg is in BLOB and for some reason I am unable to assign it to the Correlation Id. I will appreciate any help that anyone can provide.
Below is what I have tried;
Msg data in BLOB is
0x1000000)BLOB = (
(0x3000000)BLOB = X'623735616563646561343239343133653863663439326535643663353430323430303030303030303030303030303030')
DECLARE rqstBlob as BLOB;
DECLARE tCorrelId as CHAR;
SET tCorrelId = CAST(rqstBlob AS CHAR);
SET tCorrelId = 'X''' || tCorrelId || '''';
SET rqstBlob = tCorrelId;
SET "OutputRoot"."MQMD"."CorrelId" = rqstBlob;
Error:
Type mismatch assigning to variable; value ''X'X'623735616563646561343239343133653863663439326535643663353430323430303030303030303030303030303030'''' inconsistent with type 'BLOB'.
The source expression produced a value of ''X'X'623735616563646561343239343133653863663439326535643663353430323430303030303030303030303030303030'''' but the target variable was declared with a type of 'BLOB'.
Ensure that only values of the appropriate data type are assigned to declared variables.
---------
I also tried following without any luck…
SET tCorrelId = CAST(rqstBlob AS CHAR);
SET rqstBlob = tCorrelId;
SET "OutputRoot"."MQMD"."CorrelId" = rqstBlob;
Error:
Length of parser field name 'CorrelId' was '48'. It should be '24'.
The length of the value does not match the required length for the field.
Correct the application (or compute expression) that generated the message. _________________ Neinie |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 01, 2003 7:08 am Post subject: Re: Correlation ID problem |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, you do this:
Neinie wrote: |
SET tCorrelId = CAST(rqstBlob AS CHAR);
SET tCorrelId = 'X''' || tCorrelId || '''';
SET rqstBlob = tCorrelId;
SET "OutputRoot"."MQMD"."CorrelId" = rqstBlob;
|
and then it tells you
Quote: |
'X'X'623735616563646561343239343133653863663439326535643663353430323430303030303030303030303030303030'''' inconsistent with type 'BLOB'.
|
You see the duplicated "X'" at the front of that? And the duplicated "'" at the end? Those are from your second SET statement. If you don't specify a CCSID when casting a Blob to a Char, you get the character representation of the BLOB, which includes the "X'" and doesn't convert the hex characters back into binary values.
And then you try and assign a plain Character variable back to a BLOB. Which doesn't work, you need to recast it back as a BLOB.
Quote: |
---------
I also tried following without any luck…
SET tCorrelId = CAST(rqstBlob AS CHAR);
SET rqstBlob = tCorrelId;
SET "OutputRoot"."MQMD"."CorrelId" = rqstBlob;
Error:
Length of parser field name 'CorrelId' was '48'. It should be '24'.
The length of the value does not match the required length for the field.
Correct the application (or compute expression) that generated the message. |
Again, here you're assigning the character representation of the BLOB, which is 48 characters long, to the MQMD.CorrelID which is a 24 byte binary field.
Try
Code: |
set "OutputRoot"."MQMD"."CorrelID" = Cast(rqstBlob as BLOB); |
or
Code: |
set "OutputRoot"."MQMD"."CorrelID" = InputRoot.BLOB.BLOB |
. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|