Posted: Mon Oct 24, 2005 12:53 am Post subject: XML Select in a While
Voyager
Joined: 01 May 2004 Posts: 96
Hi All,
I have the following code:
DECLARE ref REFERENCE TO InputRoot.XML.ROOT.Detail[1];
CREATE FIELD OutputRoot.XML.A.Dtl;
DECLARE outRef REFERENCE TO OutputRoot.XML.A;
DECLARE I INT 1;
WHILE (LASTMOVE(ref)) DO
SET outRef.Dtl[] =
(SELECT AI.DespatchedItem.ItemIdentifier AS "item",
AI.DetailQty.Quantity AS "qty"
FROM ref.Advice.Detail[] AS AI);
MOVE ref NEXTSIBLING;
SET I = I + 1;
END WHILE;
In the above code outRef.Dtl is getting over written. The expected result is that new Dtl tag should be created under OutputRoot.XML.A for each WHILE. I have verified there is nothing wrong with the Select statement. Can any one please help me to create new Dtl tag for Each WHILE
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