Author |
Message
|
xstuvw |
Posted: Tue Nov 29, 2011 9:52 am Post subject: Declaring a Reference and Moving It |
|
|
Novice
Joined: 29 Nov 2011 Posts: 21
|
The following code does not behave how I understand it should:
Code: |
DECLARE sampleField CHARACTER 'sampleField';
CREATE LASTCHILD OF OutputRoot.XMLNSC NAME sampleField;
DECLARE outRoot REFERENCE TO OutputRoot.XMLNSC;
MOVE outRoot TO OutputRoot.XMLNSC.sampleField;
IF LASTMOVE(outRoot) THEN
RETURN TRUE;
END IF;
|
It returns true but when I step through with the debugger, outRoot is not pointing to anything. It correctly points to the XMLNSC tag but "fails" when I move it to the sample field...
Am I misunderstanding the MOVE function? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Nov 29, 2011 10:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I think you're misunderstanding the debugger. |
|
Back to top |
|
 |
xstuvw |
Posted: Tue Nov 29, 2011 10:11 am Post subject: |
|
|
Novice
Joined: 29 Nov 2011 Posts: 21
|
http://postimage.org/image/tqjwubi8x/
That is the result of my debugger at that stage, if you replace the word sampleField with UpdateCall. This, and results further down the flow, lead me to believe it's not referencing anything? |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 29, 2011 10:25 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
It correctly points to the XMLNSC tag but "fails" when I move it to the sample field... |
That is exactly what I would expect it to do.
Normally I would advise you to take a user trace, but
a) people never do, even when I suggest it and
b) smdavies99 would be sure to poke fun at me, and I'm a very sensitive person. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 29, 2011 10:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kimbert wrote: |
Normally I would advise you to take a user trace, but
a) people never do, even when I suggest it |
But on the plus side they are then caught in a trap of their own making and we can laugh at them. Or is that just me?
kimbert wrote: |
b) smdavies99 would be sure to poke fun at me, and I'm a very sensitive person. |
Aldershot - he's just lashing out against the injustice of his life.
The Trout Of Moderation stands ready to defend your sensibilities. None shall upset the God Of Message Parsing. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
xstuvw |
Posted: Tue Nov 29, 2011 12:14 pm Post subject: |
|
|
Novice
Joined: 29 Nov 2011 Posts: 21
|
I have found my user traces but I don't believe I have mqsireadlog functionality on this computer. All my logs are in the format *.bin.* if that's correct?
EDIT: I apologize, I have found how to use mqsireadlog. I will upload one in a second. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 29, 2011 12:33 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
xstuvw wrote: |
EDIT: I apologize, I have found how to use mqsireadlog. I will upload one in a second. |
If the user trace (which is not quite the same as the default log) doesn't enable you to spot the problem. Which it may well do.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
xstuvw |
Posted: Tue Nov 29, 2011 12:33 pm Post subject: |
|
|
Novice
Joined: 29 Nov 2011 Posts: 21
|
aaaaaaa
Last edited by xstuvw on Wed Nov 30, 2011 1:06 pm; edited 2 times in total |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 29, 2011 12:39 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
So what do you see happening?
How does this vary from what you expect your code to be doing? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Nov 29, 2011 12:46 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Vitor wrote: |
Aldershot - he's just lashing out against the injustice of his life.
The Trout Of Moderation stands ready to defend your sensibilities. None shall upset the God Of Message Parsing. |
How's life in the 'Rust-Belt'?
I'm sure my Ghurka neighbours will help me repel boarders....
(ex RSM 2nd Btn)
includng those coming up the A31....  _________________ 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 |
|
 |
xstuvw |
Posted: Tue Nov 29, 2011 12:46 pm Post subject: |
|
|
Novice
Joined: 29 Nov 2011 Posts: 21
|
I don't see anything that stands out as erroneous. I declare a CHARACTER variable, create a last child of the XMLNSC node, set a reference to that node, and then move it to the newly created last child... |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 29, 2011 12:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
xstuvw wrote: |
I don't see anything that stands out as erroneous. |
So the problem is......? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 29, 2011 12:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
How's life in the 'Rust-Belt'? |
Ohio has many things to recommend it. Endless oppertunities for moody photographs of decaying industrial buildings for one.
(Other Ohio / USA residents feel free to chip in. Please.) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
xstuvw |
Posted: Tue Nov 29, 2011 12:58 pm Post subject: |
|
|
Novice
Joined: 29 Nov 2011 Posts: 21
|
The code isn't acting as intended - which may in fact be how I am using the functions... But I'm afraid I'm missing your hints; if the lines of code in my OP are working as they should, my next question is how do write the ESQL such that the reference actually refers to the child of XMLNSC? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 29, 2011 1:03 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
xstuvw wrote: |
my next question is how do write the ESQL such that the reference actually refers to the child of XMLNSC? |
So let's tackle this a different way. What (apart from the debugger) makes you think the reference isn't pointing to the child of XMLNSC and what did you intend the code to do? What is the difference between what the user trace says the code is doing and what you intend the code to do? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|