|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Storing and reading incoming msg from DB |
« View previous topic :: View next topic » |
Author |
Message
|
amerlin |
Posted: Thu Dec 08, 2011 2:40 am Post subject: Storing and reading incoming msg from DB |
|
|
Newbie
Joined: 28 Nov 2011 Posts: 4
|
Hello,
I'm stuck with pretty simple task - I get some xml msg from MQ queue(MQInput) add/append some nodes(xml tags)(Java compute node) store result in DB(DB node), after that when to read what is stored in db(Compute node) and proccess this farther..
Here code snipped I use to store to DB
INSERT INTO Database.TEST(SOME) VALUES(
ASBITSTREAM(Root.XMLNSC));
That is fine,
Now I'm trying to fetch msg from DB, for example in this way:
SET OutputRoot.XMLNSC = (THE (SELECT T.SOME FROM Database.TEST as T WHERE T.SOMEID=1));
But the result is diff from what I stored - It adds 1 extra tag - SOME(as column name in DB or I can give some alias I guess) but I don't need it
Also, the value of this node is whole content that is in DB column, it seems it is trated as text and not parsed..
Any ideas how I can read/restore msg exactly in the same fromat as it was stored ?
Thank you |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Dec 08, 2011 3:39 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
You are storing you xml in bistream format so you need to parse it with XMLNSC parser after you have fetched it from db. Use Row variable, Environment or Local Environment as temporary cache. That is direct the result from select clause there and use create statement with parse clause to build your OutputRoor.XMLNSC subtree.
--
Marko |
|
Back to top |
|
 |
amerlin |
Posted: Thu Dec 08, 2011 3:55 am Post subject: |
|
|
Newbie
Joined: 28 Nov 2011 Posts: 4
|
Hi Marko,
Thank you,
Can you give me some idea how to do it ?
I mean, how to use parser can't find good example on it
I did
SET OutputLocalEnvironment.MyData = THE (SELECT T.SOME FROM Database.TEST as T WHERE T.SOMEID=1);
After that I need to do something like
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(OutputLocalEnvironment.MyData);
But it is not working - throwing excpetion, some params missing...or ?
Any ideas ? |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Dec 08, 2011 5:34 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
|
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
|
|
|
|