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 » BITSTREAM

Post new topic  Reply to topic
 BITSTREAM « View previous topic :: View next topic » 
Author Message
neo_revolution
PostPosted: Thu Jan 29, 2004 6:00 am    Post subject: BITSTREAM Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

Hello,

I am getting Input as XML fomat. I need to convert a part of XML into BITSTREAM and insert into database. Like....

DECLARE blobMsg BLOB;

SET blobMsg = BITSTREAM(InputRoot.XML.PurchaseOrder.Details);

INSERT INTO Database.INVOICE VALUES(-, -, blobMsg);

But my entire message is being converting into BITSTREAM and being inserted into database. But I need only a part of my XML to be inserted.

Thx.
Back to top
View user's profile Send private message Yahoo Messenger
Meow
PostPosted: Thu Jan 29, 2004 6:09 am    Post subject: Reply with quote

Voyager

Joined: 25 Jun 2003
Posts: 95

try this...

copy the subtree into a new element.

ECLARE myCardinality INTEGER;
DECLARE myIndex INTEGER;

SET myIndex = 1;
SET myCardinality = CARDINALITY ("InputRoot"."XML"."Msg"."CharBody".*[]);

WHILE myIndex <= myCardinality DO
SET OutputRoot.XML.Record.*[myIndex] = "InputRoot"."XML"."Msg"."CharBody".*[myIndex];
SET myIndex = myIndex + 1;
END WHILE;

this would copy the

<Msg><CharBody><a>123</a><b>36346</b></CharBody></Msg>

the output would be

<Record><a>123</a><b>36346</b></Record>

have you tried the ATTACH and DETATCH functions?
Back to top
View user's profile Send private message
neo_revolution
PostPosted: Thu Jan 29, 2004 6:15 am    Post subject: BITSTREAM Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

This looks good. But I don't want it to be attached to another tag like you mentioned <Record></Record>, I just need XML b/n two tags... If I do as you mentioned I am adding some extra element.

The problem is the data in the bitstream what I am getting is a variable data and I don't know what that is, can be XML but the structure is not known.

Thx
Back to top
View user's profile Send private message Yahoo Messenger
jefflowrey
PostPosted: Thu Jan 29, 2004 7:17 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

First off, use ASBITSTREAM instead of BITSTREAM for any version of WMQI later than 2.1 CSD02.

Second, you need to be a bit wary of arbitrarily taking a subsection of XML. If, for instance, I took all children of element "B" in the following XML, it would cause a problem.
<A>
<B>
<C>
<C1>value</c1>
<C2>value</c2>
</C>
<D>
<D1>value</D1>
<D2>value</D2>
</D>
</B>
</A>

Element B has two distinct children. If you tried to parse a bistream of everything contained within <B> and </B>, you would get a document with two roots (<C> and <D>)!
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
neo_revolution
PostPosted: Thu Jan 29, 2004 7:28 am    Post subject: BITSTREAM Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

I see the point..

I am passing child of <A>. Should not be any problem... I will check.

<A>
<B>
<C>
<C1>value</c1>
<C2>value</c2>
</C>
<D>
<D1>value</D1>
<D2>value</D2>
</D>
</B>
</A>

Thx
Back to top
View user's profile Send private message Yahoo Messenger
neo_revolution
PostPosted: Fri Jan 30, 2004 7:17 pm    Post subject: ASBITSTREAM Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

Can anyone give me how to use ASBITSTREAM... I tried to use but its giving me this error...

BIP2938E: An attempt was made to execute the non existent function or procedure 'ASBITSTREAM'. An attempt was made to execute the function or procedure 'ASBITSTREAM' but no such function or procedure has been defined. All functions and procedures must be defined in the node that uses them. Examine and correct the SQL program

Thanks in advance.
Back to top
View user's profile Send private message Yahoo Messenger
EddieA
PostPosted: Fri Jan 30, 2004 8:51 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

ABITSTREAM was introduced with CSD3 on V2.1. Sounds like you are at a lower level.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
neo_revolution
PostPosted: Tue Feb 03, 2004 8:57 am    Post subject: ASBITSTREAM Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

Hello,

This is what I did to convert a sub-xml tree to bitstream, so as I can convert it into BLOB to store in DB2 database...

DECLARE msgBlob BLOB;
SET msgBlob = ASBITSTREAM(InputRoot.XML.Body.Invoice OPTIONS FolderBitStream);

INSERT INTO ......

But I am unable to fine good documentation to see what ASBITSTREAM can do.

Do anyone have idea?

Thanks in advance.
Back to top
View user's profile Send private message Yahoo Messenger
dhincali
PostPosted: Tue Feb 03, 2004 9:57 am    Post subject: Reply with quote

Novice

Joined: 29 Dec 2003
Posts: 22

Hi Neo,

Here is the link where you can get good info on what you want on ASBITSTREAM function.

ftp://ftp.software.ibm.com/software/integration/wbibrokers/docs/messagebroker_esql.pdf
_________________
learning traveller
Back to top
View user's profile Send private message
neo_revolution
PostPosted: Tue Feb 03, 2004 12:26 pm    Post subject: Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

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

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » BITSTREAM
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.