Author |
Message
|
rajmq |
Posted: Fri Oct 12, 2007 1:18 am Post subject: Large XML message insert !! |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
All,
Able to insert the single xml message using simple message flow but if the same XML contains many transaction i have to insert the each transaction as separate record.
In this case how do i write the dynamic esql for insert ? also more transaction (<50) records in a single message so what is best way to write the code without impacting the performace.
TIA
 _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 12, 2007 1:36 am Post subject: Re: Large XML message insert !! |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rajmq wrote: |
Able to insert the single xml message using simple message flow but if the same XML contains many transaction i have to insert the each transaction as separate record.
|
Do you mean insert into a database?
Simplist solution is to put a compute node in front of your existing insert that takes each transaction and propogates it to the existing one.
Other, possibly better and more elegant solutions may be available. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shalabh1976 |
Posted: Fri Oct 12, 2007 7:46 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
I hope you already know about looping using Cardinality or MoVE/LASTMOVE. That will make your code dynamic.
Also for performance there are many posts available and you can also check developerworks for guidance on the same.
I think what you want is guidance in developing flows that handle large messages.
These posts and developerworks should help you there. _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
rajmq |
Posted: Fri Oct 12, 2007 8:01 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
i have an issue while spliting the records, when i use the below code it is fetching different items and passing to another compute node for inserting but their no.of record count is (OutputRoot.XML.ITEM ) showing null ..
DECLARE I INTEGER 1;
DECLARE J INTEGER;
DECLARE rTran REFERENCE TO InputRoot.XML.testxml.generterequest;
SET J = CARDINALITY(rTran.itmes[]);
WHILE I <= J DO
SET OutputRoot = InputRoot;
SET OutputRoot.XML.ITEM = rTran.items[I];
PROPAGATE;
SET I = I+1;
END WHILE;
 _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Oct 12, 2007 8:16 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi rajmq,
Quote: |
SET J = CARDINALITY(rTran.itmes[]); |
I think the problem is with the spelling...
Regards. |
|
Back to top |
|
 |
rajmq |
Posted: Fri Oct 12, 2007 8:23 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Thanks for pointing that..but
esql code is correct SET J = CARDINALITY(rTran.items[])
able to print the value in the compute code but not in the next node. _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 12, 2007 9:06 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There are a number of basic mistakes in how you've coded this, from a performance/memory perspective. One is that you're always sending out the full message every time. Another is that you're using message indexes, instead of references. Also, you're using the XML Domain.
In addition, OutputRoot.XML.ITEM is not going to be the count of anything. It's going to be a duplicate of whatever is the Ith item of InputRoot.XML.testxml.generaterequest.items.
And finally, you're creating an OutputRoot.XML message tree that has two root nodes - ITEM and testxml. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
rajmq |
Posted: Fri Oct 19, 2007 5:33 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
|
Back to top |
|
 |
|