Author |
Message
|
gsreddy121 |
Posted: Thu Aug 14, 2014 11:24 pm Post subject: last move |
|
|
Newbie
Joined: 14 Aug 2014 Posts: 3
|
SET OutputRoot=InputRoot;
DECLARE K INTEGER 0;
DECLARE myref REFERENCE TO OutputRoot.XMLNSC.Data.Order.Item[1];
WHILE LASTMOVE(myref) = TRUE DO
SET OutputRoot.XMLNSC.Data.Order.Item[K]= K;
SET K = K + 1;
SET myref = myref + 1;
MOVE myref NEXTSIBLING;
END WHILE;
INPUT:
<Data><Order><Item></Item><Item></Item><Item></Item></Data>
i am not getting output,please give me solution for this. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Aug 15, 2014 12:38 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Would you please like to explain what you are trying to do?
There is one issue in the K has an initial value of 0 indexes with a value of 0 are not allowed in ESQL
But please explain what you are trying to do. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 15, 2014 4:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
Would you please like to explain what you are trying to do? |
Logically, that code doesn't make sense. What's the expected output? You're almost certainly getting no output because at some point in that twisted loop you get a null, and hence delete the output tree.
A user trace would have shown you this. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Aug 15, 2014 4:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried changing your code to the following?
Code: |
SET OutputRoot=InputRoot;
DECLARE K INTEGER 0;
DECLARE myref REFERENCE TO OutputRoot.XMLNSC.Data.Order.Item[1];
WHILE LASTMOVE(myref) DO
SET K = K + 1;
SET myref = K;
MOVE myref NEXTSIBLING;
END WHILE; |
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Aug 15, 2014 4:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 15, 2014 5:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
@gsreddy121 - what exactly are you trying to achieve here? All you seem to have managed is to confuse everyone.
How did you arrive at the code you posted? What did you reference to write it? What diagnostic steps have you taken and what results did you obtain? Can you post these?
Better information, better advice and certainly less confusion.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|