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 » best way to store XML message in DB2 VARCHAR?

Post new topic  Reply to topic
 best way to store XML message in DB2 VARCHAR? « View previous topic :: View next topic » 
Author Message
Saadat
PostPosted: Mon May 16, 2005 5:34 am    Post subject: best way to store XML message in DB2 VARCHAR? Reply with quote

Newbie

Joined: 16 May 2005
Posts: 5
Location: IBM Greenock, UK

Dear all,
What is the best way to store XML message in DB2 VARCHAR column using WBIMB v5?

Sample message in input Q
----------------------------------

<Message>

<header_1>a</header_1>
<header_2>b</header_2>
<header_n>c</header_n>
<doc>
<field_1>x</field_1>
<field_2>y</field_2>
<field_n>z</field_n>
</doc>

</Message>

I would like to store above message including XML tags in DB2 VARCAHR colum as string.

Required sample message in DB2 VARCHAR column
-------------------------------------------------------------
"<Message>

<header_1>a</header_1>
<header_2>b</header_2>
<header_n>c</header_n>
<doc>
<field_1>x</field_1>
<field_2>y</field_2>
<field_n>z</field_n>
</doc>

</Message>"

Your assistance would be much appreciated.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon May 16, 2005 5:49 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You want to search for 'ASBITSTREAM', or 'XML to BLOB'.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
CHF
PostPosted: Mon May 16, 2005 6:10 am    Post subject: Reply with quote

Master

Joined: 16 Dec 2003
Posts: 297

DECLARE msgBlob BLOB;

SET msgBlob = ASBITSTREAM(InputRoot.XML.Envelope.Body.logDta
OPTIONS FolderBitStream);
_________________
CHF
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Saadat
PostPosted: Mon May 16, 2005 6:29 am    Post subject: Reply with quote

Newbie

Joined: 16 May 2005
Posts: 5
Location: IBM Greenock, UK

Many thanks guys, found the solution under ASBITSTREAM.
Back to top
View user's profile Send private message
Saadat
PostPosted: Tue May 17, 2005 1:56 am    Post subject: Reply with quote

Newbie

Joined: 16 May 2005
Posts: 5
Location: IBM Greenock, UK

For the benefit of other folks here is the piece of code which i used to solve my problem.
----------------------------------
DECLARE MSG_BLOB BLOB;
DECLARE MSG_DATA CHAR;

SET MSG_BLOB = ASBITSTREAM(InputRoot.XML OPTIONS RootBitStream);
SET MSG_DATA = CAST( MSG_BLOB AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
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 » best way to store XML message in DB2 VARCHAR?
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.