Author |
Message
|
rasol |
Posted: Wed Dec 20, 2006 1:48 pm Post subject: insert XML in output tree |
|
|
Novice
Joined: 08 Aug 2006 Posts: 14
|
I got data from DB2 and stored in EV as
E.V.temp[] =
<DetailRecords>
<Name>D2</Name>
<Location>
<Locationcode>
<code>RFC</code>
<Amount>90</Amount>
<Amount>80</Amount>
<Locationcode>
<Location>
</DetailRecords>
Output Tree has a XML structure as
<Message>
<Data>
<DetailRecords>
<Name>D1</Name>
<Location>
<code>TDK</code>
<Amount>10</Amount>
<Amount>20</Amount>
<Location>
</DetailRecords>
<TotAmount>1700<TotAmout>
</Data>
</Message>
I wan to insert E.V.temp[] into Output tree.
Expected Outputtree should look like
<Message>
<Data>
<DetailRecords>
<Name>D1</Name>
<Location>
<code>TDK</code>
<Amount>10</Amount>
<Amount>20</Amount>
<Location>
</DetailRecords>
<DetailRecords>
<Name>D2</Name>
<Location>
<Locationcode>
<code>RFC</code>
<Amount>90</Amount>
<Amount>80</Amount>
<Locationcode>
<Location>
</DetailRecords>
<TotAmount>1700<TotAmout>
</Data>
</Message>
Any Help. |
|
Back to top |
|
 |
sarat |
Posted: Wed Dec 20, 2006 9:43 pm Post subject: |
|
|
 Centurion
Joined: 29 Jun 2005 Posts: 136 Location: India
|
Hi rasol,
are you using any message sets or you want to hardcode??? _________________ With Regards,
Sarat. |
|
Back to top |
|
 |
sarat |
Posted: Wed Dec 20, 2006 9:48 pm Post subject: |
|
|
 Centurion
Joined: 29 Jun 2005 Posts: 136 Location: India
|
If you want to hard code...first check the cardinality of the E.V.temp[] then repaet the loop that much times... _________________ With Regards,
Sarat. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Dec 21, 2006 9:56 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Look at the ATTACH statement.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Dec 21, 2006 10:22 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
And why can't I have a variable type of LIST?
I hate sticking stuff in Environment that I don't need beyond the current function/procedure. It makes it messy.
I know, detach the reference and delete it when done. _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 21, 2006 11:13 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
JosephGramig wrote: |
And why can't I have a variable type of LIST? |
well, in v6 you can have a variable type ROW. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Dec 21, 2006 12:20 pm Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
yes, but I cannot select a bunch of rows out and assign them to a local variable. _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 21, 2006 1:02 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
JosephGramig wrote: |
yes, but I cannot select a bunch of rows out and assign them to a local variable. |
...
I think that's exactly what a ROW variable is for... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Dec 21, 2006 1:24 pm Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
No, it contains exactly one ROW.
You must use the THE statement to assign to it and it returns just the first row. Otherwise, you must assign to a WHATEVER[] to assign a LIST.
There is no LIST data type that you can declare. I've tried it. _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 21, 2006 1:29 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
From the Message Routing sample in the samples gallery...
Code: |
declare CacheQueueTable SHARED ROW; -- a shared variable that can be used by instances of a flow
....
SET CacheQueueTable.DestinationData[] =
(
SELECT S.QUEUE_MANAGER, S.QUEUE_NAME ,S.VARIABLE2, S.VARIABLE3
FROM Database.ROUTING_TABLE as S
WHERE
S.VARIABLE1 = Variable1); |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Dec 21, 2006 2:31 pm Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
Well, I never saw the example with the extra element of the ROW. I was trying to return it to the name directly, which works for one ROW.
Live and learn. That example would be nice in the documentation though. _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
mgk |
Posted: Thu Dec 21, 2006 3:01 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
The easiest way to understand a ROW variable is to see it as a User defined Tree (which is exactly what it is). Anything you can do with the Environment tree or LocalEnvironment tree can be done to variables of type ROW in V6.
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|