|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
CAST XML field to BLOB |
« View previous topic :: View next topic » |
Author |
Message
|
matuwe |
Posted: Thu Jun 24, 2010 7:26 am Post subject: CAST XML field to BLOB |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
Hi Please help.
I am retrieving data from DB and I have the results as XML. I need to take the whole XML and CASE it to BLOB OR BITSTREAM, I keep getting an empty field after the CAST. I think it is taking the root tag value and not the whole XML. How can I do this..
Pls help |
|
Back to top |
|
 |
matuwe |
Posted: Thu Jun 24, 2010 7:44 am Post subject: |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
I have tried DECLARE wholeMsgBlob1 BLOB CAST(InputBody AS BLOB);
DECLARE StatementBitStream BLOB
ASBITSTREAM(InputBody OPTIONS FolderBitStream)
and it seems to work, but now my problem is I sometimes receive plain charecter data, and not XML. Which method can I use to convert anything and everything that comes to my Queue to a BLOB, unfortunatly I cannot use the MQinput Q Node domain, that would have been my first chooise.
Thanks  |
|
Back to top |
|
 |
AndreasMartens |
Posted: Fri Jun 25, 2010 1:54 am Post subject: Infocenter |
|
|
 Acolyte
Joined: 30 Jan 2006 Posts: 65 Location: Hursley, UK
|
Hi,
Have you looked at the infocenter? Specifically this topic:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ac67175_.htm
(taken from v7 docs, you didn't specify the version you were using).
You're creating your StatementBitStream BLOB as a FolderBitStream of the InputBody, are you sure you didn't want RootBitStream??? Here's a quick example that shows the main uses:
-- Declare a couple variables...
DECLARE msgBody BLOB;
DECLARE msgBodyChar CHAR;
-- Set the BLOB to be the whole XML tree, the defaults (OPTIONS RootBitStream & ValidateNone, CCSID and ENCODING 0 and set, type and format '') are fine:
SET msgBody = ASBITSTREAM( InputRoot.XMLNSC );
-- Convert the BLOB to a character string, handy for adding into other non-xml messages with embedded messages (and for tracing)...
SET msgBodyChar = CAST(msgBody AS CHAR CCSID 1208 ENCODING InputProperties.Encoding);
-- Can anyone spot the mistake above?
-- Use the above string as a subtree of an existing XMLNSC tree
CREATE LASTCHILD OF OutputRoot.XMLNSC.Data PARSE( msgBodyChar,InputProperties.Encoding );
-- again, spot the mistake...!
hope this helps,
Andreas |
|
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
|
|
|
|