|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
problem using REFERENCE |
« View previous topic :: View next topic » |
Author |
Message
|
pfaulkner |
Posted: Thu Oct 16, 2003 11:25 am Post subject: problem using REFERENCE |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
Does anyone know if this ESQL is correct, my output message seems to be corrupt. I've tried removing the PROCEDURE's and still get the same problem so it appears to be an issue with REFERENCE. If I remove the reference code and the procedures my output looks as excepted.
My input message is XML.
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
SET OutputRoot.Properties.MessageSet = 'DU543NS07K001';
SET OutputRoot.Properties.MessageType = 'MRMBLOB';
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
DECLARE InBody REFERENCE TO InputBody.MRMBLOB;
DECLARE OutRoot REFERENCE TO OutputRoot;
CALL BuildSegment1(InBody, OutRoot);
CALL BuildSegment2(InBody, OutRoot);
SET OutputRoot.Properties.MessageFormat = 'CWF';
CREATE PROCEDURE BuildSegment1(IN InBody REFERENCE, INOUT OutRoot REFERENCE)
BEGIN
SET "OutRoot"."MRM"."SEGMENTCOUNT" = 1;
SET "OutRoot"."MRM"."MRM1"."field2" = InBody.MRMBLOB."field2";
SET "OutRoot"."MRM"."MRM1"."field1" = '12345';
END;
CREATE PROCEDURE BuildSegment2(IN InBody REFERENCE, INOUT OutRoot REFERENCE)
BEGIN
SET "OutRoot"."MRM"."SEGMENT2COUNT" = 1;
SET "OutRoot"."MRM"."MRM2"."field2" = '2';
END; |
|
Back to top |
|
 |
Missam |
Posted: Fri Oct 17, 2003 4:58 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Hi,
The Problem with your ESQL statements is
DECLARE OutRoot REFERENCE TO OutputRoot;
In the above statement you are referencing to OutputRoot tree which is not existing.you can nitice this by turning on your user trace debugging.
try removing that line and replacing OutputRoot where ever OutRoot is or try creating the fields before REFERENCING them.
Thanx
sam |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 17, 2003 6:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
IamSam wrote: |
Hi,
The Problem with your ESQL statements is
DECLARE OutRoot REFERENCE TO OutputRoot;
In the above statement you are referencing to OutputRoot tree which is not existing. |
I don't think that's true, nor the problem. His reference statement occurs after the code to copy the headers has been executed. That means that the OutputRoot tree has already been created and partially filled in.
I think pfaulker is having another varient on the problem discussed here, that he was having while trying to use references to copy the Properties tree.
That is, he's not creating OutputRoot.MRM properly, because he's using a reference to set all it's fields, and the parser is not getting properly attached to the MRM tree.
At least, at a guess without more information. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
pfaulkner |
Posted: Fri Oct 17, 2003 7:56 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
thank you thank you thank you Jeff
I added the following code and it fixed all my problems
/*Create the XML Parser before we use it*/
CREATE LASTCHILD OF OutputRoot DOMAIN 'MRM'; |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 17, 2003 9:43 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
pfaulkner wrote: |
thank you thank you thank you Jeff |
Don't thank me. Thank Brandon. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|