Posted: Thu Jun 24, 2004 2:44 am Post subject: Strange deployment message using FOR statement
Centurion
Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden
Hi all,
Look at this piece of code:
Code:
CREATE PROCEDURE CorrelateITEM_DISCOUNT(INOUT Receipt REFERENCE)
BEGIN
DECLARE Itm REFERENCE TO Receipt;
MOVE Itm FIRSTCHILD NAME 'ITEM';
WHILE LASTMOVE(Itm) DO
DECLARE Dscnt REFERENCE TO Receipt;
MOVE Dscnt FIRSTCHILD NAME 'DISCOUNT';
WHILE LASTMOVE(Dscnt) DO
IF Itm.SequenceNumber = Dscnt.SequenceNumber THEN
SET Dscnt.REF_LINE_NO = Itm.LINE_NO;
SET Dscnt.SequenceNumber = NULL;
END IF;
MOVE Dscnt NEXTSIBLING NAME 'DISCOUNT';
END WHILE;
SET Itm.SequenceNumber = NULL;
MOVE Itm NEXTSIBLING NAME 'ITEM';
END WHILE;
-- FOR Itm AS Receipt.ITEM[] DO
-- FOR Dscnt AS Receipt.DISCOUNT[] DO
-- IF Itm.SequenceNumber = Dscnt.SequenceNumber THEN
-- SET Dscnt.REF_LINE_NO = Itm.LINE_NO;
-- SET Dscnt.SequenceNumber = NULL;
-- END IF;
-- END FOR;
-- SET Itm.SequenceNumber = NULL;
-- END FOR;
END;
My first attempt at this Procedure is the part that is commented out. It gives the following error message when I try to deploy it:
Quote:
BIP2523E: (.WED009SalesReceipt_Map.CorrelateITEM_DISCOUNT, 7.6) : Cannot assign to a symbolic constant or input message.
Values cannot be assigned to symbolic constants or input message fields.
Correct the syntax of the expression and redeploy the message flow.
After doing som major head-scratching, I wrote the same logic using ref-variables instead. No error. Either I'm missing something basic here, or else it smells like PMR time. Any ideas?
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