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 » XML - how to add many occurences with CREATE?

Post new topic  Reply to topic
 XML - how to add many occurences with CREATE? « View previous topic :: View next topic » 
Author Message
Testo
PostPosted: Thu Jan 27, 2005 4:02 am    Post subject: XML - how to add many occurences with CREATE? Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

I'm trying to improve the performance of some ESQL code I have written. The XML message has a similar structure:

Code:

<Product>...</Product>
<Position><a>...</a><b>...</b></Position>
<Position><a>...</a><b>...</b></Position>


The element Product occurs only once while the element Position occurs many times (up to 800).

Now, in the while loop responsible of the Position elements, I have tried to use a REFERENCE variable instead of OutputRoot.XML.Position[i] but I have some problems after the creation of the first occurence of the Position element. I have looked at many posts in this forum and tried many different instructions but with no success. Here is my code:

Code:

      -- header >> Product
      CREATE FIRSTCHILD OF OutputRoot.XML.Product;
      DECLARE prod REFERENCE TO OutputRoot.XML.Product;
      
      SET prod.idProduct = codProdotto;
      etc etc      
      -- /header >> Product
      
      SET cont = LENGTH(msgResiduo) / 236;
      SET i = 1;
      
      WHILE (i <= cont) DO
         
         CREATE FIELD OutputRoot.XML.Position;
         --CREATE NEXTSIBLING OF OutputRoot.XML NAME 'Position';
         DECLARE pos REFERENCE TO OutputRoot.XML.Position[i];
      
         
         SET body = SUBSTRING(msgResiduo FROM 1 FOR 236);
         
         -- body >> Position
                  
         SET pos.idProduct = codProdotto;
         etc etc         
         
         -- /body >> Position
         
         SET msgResiduo = SUBSTRING(msgResiduo FROM 237);
         SET i = i + 1;
         
      END WHILE;


Once in the WHILE loop, the instruction "CREATE FIELD OutputRoot.XML.Position" does not create the second element Position in the OutputRoot.XML tree; consequently, all the elements created with the "pos" reference are added to the OutputRoot.XML tree but not under any Position element.

I need some support please.

Thanks
Andrea
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jefflowrey
PostPosted: Thu Jan 27, 2005 5:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I might use a LIST or ROW operator to create a repeating structure like that.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Testo
PostPosted: Thu Jan 27, 2005 6:26 am    Post subject: Thanks Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

Jeff,

with the ROW function, I have improved the performance by 20-25%...

THANKS!
Andrea
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML - how to add many occurences with CREATE?
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.