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 » Convert a String to a blob

Post new topic  Reply to topic
 Convert a String to a blob « View previous topic :: View next topic » 
Author Message
huebi
PostPosted: Mon Aug 20, 2001 4:17 am    Post subject: Reply with quote

Novice

Joined: 01 Jul 2001
Posts: 16

Hi,

is there really no built-in converting from characters to BLOBs?

DECLARE x CHARACTER;

SET x = 'XYZ';

CAST(x AS BLOB) does not a converting.

Of course i can write a little bit of code, but i cant reuse this code
as a function mpdule and i need this several times in a Compute node.

Back to top
View user's profile Send private message
kolban
PostPosted: Tue Aug 21, 2001 5:35 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

You may wish to look at the TREEASIS parser. The question I am most interested in is why do you wish to convert a string to a blob?
Back to top
View user's profile Send private message
Tibor
PostPosted: Tue Aug 21, 2001 5:50 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

>why do you wish to convert a string to a blob?

Because there are BLOB values, like MQMD.CorrelID.

Dummy solution for casting:
1. insert into a database table
2. read back with a select

Ugly, but works...
Back to top
View user's profile Send private message
huebi
PostPosted: Wed Aug 22, 2001 10:27 pm    Post subject: Reply with quote

Novice

Joined: 01 Jul 2001
Posts: 16

Quote:

On 2001-08-21 06:35, kolban wrote:
You may wish to look at the TREEASIS parser. The question I am most interested in is why do you wish to convert a string to a blob?


I have to write some Data in front of a Msg varying in Size. Something like a header. Of course i can say

DECLARE desc BLOB;

SET desc '41643b45....
SET inblob = desc || inblob

but i would be more readable and more failsave if i can declare desc as character and fill in a readable description.

Evrytime this not-understable limitation of fixed-length messages in MRM hits me.

Back to top
View user's profile Send private message
wolstek
PostPosted: Thu Aug 30, 2001 5:57 am    Post subject: Reply with quote

Acolyte

Joined: 25 Jun 2001
Posts: 52
Location: Bristol, UK

I likewise have wished that you could cast a string into a BLOB for various reasons. e.g. when manipulating BLOB strings for xmit to IMS for example.
The way I have got around it is to use the BITSTREAM function though this obviously has limitations of working on a complete message tree and that you may have to do the BITSTREAM in a succeeding node.

Asuming input to Compute node is MRM, the following will cast the entire MRM string into BLOB format.

DECLARE C BLOB;
SET C = BITSTREAM(InputRoot.MRM);
Back to top
View user's profile Send private message
kolban
PostPosted: Thu Aug 30, 2001 7:14 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

When using TREEASIS, you can append string to blob ...


SET OutputRoot.TREEASIS.data1 = 'This is a string';
SET OutputRoot.TREEASIS.data2 = 0x'123456';


When put to the queue, you will have a message that contains
"This is a string <0x12><0x34><0x56>"
Back to top
View user's profile Send private message
huebi
PostPosted: Fri Aug 31, 2001 12:19 am    Post subject: Reply with quote

Novice

Joined: 01 Jul 2001
Posts: 16

Quote:



SET OutputRoot.TREEASIS.data1 = 'This is a string';
SET OutputRoot.TREEASIS.data2 = 0x'123456';


When put to the queue, you will have a message that contains
"This is a string <0x12><0x34><0x56>"


Thats not human readable, and making errors ist guaranteed.
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 » Convert a String to a blob
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.