|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
CAST BLOB to Char |
« View previous topic :: View next topic » |
Author |
Message
|
KT |
Posted: Fri Oct 17, 2003 10:30 am Post subject: CAST BLOB to Char |
|
|
Newbie
Joined: 09 Oct 2003 Posts: 7
|
How can I cast the whole hexidecimal BLOB message to a char string? |
|
Back to top |
|
 |
kolban |
Posted: Fri Oct 17, 2003 11:27 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
I am not sure if this is possible in ESQL, but if you were to use the JavaScript node (see http://www.kolban.com/mbjavascript/)
Then something like:
Code: |
var myBlob = myHelper.getValue(inMessage, "BLOB/BLOB");
var myString = new java.lang.String(myBlob);
|
would work. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Oct 18, 2003 5:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm confused Kolban.
Why can't KT just use
Code: |
Set myString = Cast (InputRoot.BLOB.BLOB as character CCSID InputRoot.Properties.CodedCharSetId); |
KT's probably having the standard problem of not specifing a CCSID to the cast function, so is getting the 'hex' representation of the BLOB bytes as a string, rather than a 'normal' string. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kolban |
Posted: Sat Oct 18, 2003 1:49 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Sorry guys, I was out of step with the latest happenings. I thought ESQL only converted BLOB to a hex representation and missed that one could now convert to a character set string.
This is by far the better approach. Apologies for the confusion. |
|
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
|
|
|
|