ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Converting from BLOB to CHAR

Post new topic  Reply to topic
 Converting from BLOB to CHAR « View previous topic :: View next topic » 
Author Message
wyatt
PostPosted: Tue Sep 19, 2006 8:42 am    Post subject: Converting from BLOB to CHAR Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

Good People

Using ESQL, how can I cast a BLOB data type to CHAR data type?

For example

DECLARE bData BLOB;
SET bData = Substring(InputRoot.BLOB.BLOB from 4 for 4);

SET Environment.chData = CAST (bData as CHAR);

The message flow debugger displays expected message types; e.g. SET Environment.chData is CHARACTER but the contents are represented as with value X'42434143'.

Subquent String functions on Environment.chData do not provide expected results; e.g
DECLARE myVar CHAR;
SET myVar= SUBSTRING(Environment.chData from 1 for 1);
...myVar contians 'X'

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 19, 2006 8:49 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Using the CAST function.

If it's not coming out the way you expect it to, you probably need to supply a CCSID parameter.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wyatt
PostPosted: Tue Sep 19, 2006 9:07 am    Post subject: Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

Adding CCSID worked.

Thx
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Converting from BLOB to CHAR
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.