ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem With PROPAGATE Statement

Post new topic  Reply to topic
 Problem With PROPAGATE Statement « View previous topic :: View next topic » 
Author Message
raghug
PostPosted: Fri Jun 15, 2007 6:38 am    Post subject: Problem With PROPAGATE Statement Reply with quote

Acolyte

Joined: 19 Jul 2006
Posts: 60
Location: NJ

Hi All
When I used PROPAGATE Statement I got Exception Please correct my Esql if any mistake ...

CALL CopyMessageHeaders();
-- SET OutputRoot.XML.Book_Order_Response_MSG = InputRoot.XML.Create_Book_Order_MSG;
SET OutputRoot.XML.Book_Order_Response_MSG.Customer_ID = InputRoot.XML.Create_Book_Order_MSG.Customer_ID;
DECLARE input TIMESTAMP InputRoot.XML.Create_Book_Order_MSG.Order_Date;
DECLARE pattern CHARACTER 'yyyyMMddHHmmss';
DECLARE orderDate CHARACTER CAST(input AS CHARACTER FORMAT pattern);
SET OutputRoot.XML.Book_Order_Response_MSG.Order_Number = InputRoot.XML.Create_Book_Order_MSG.Customer_ID || orderDate;
SET OutputRoot.XML.Book_Order_Response_MSG.Order_Date = InputRoot.XML.Create_Book_Order_MSG.Order_Date;

DECLARE deliveryPrice DECIMAL;
IF InputRoot.XML.Create_Book_Order_MSG.First_Class = 'Yes' THEN
SET OutputRoot.XML.Book_Order_Response_MSG.First_Class = InputRoot.XML.Create_Book_Order_MSG.First_Class;
SET deliveryPrice = 18.00;
END IF;

IF InputRoot.XML.Create_Book_Order_MSG.Second_Class = 'Yes' THEN
SET OutputRoot.XML.Book_Order_Response_MSG.Second_Class = InputRoot.XML.Create_Book_Order_MSG.Second_Class;
SET deliveryPrice = 12.00;
END IF;

IF InputRoot.XML.Create_Book_Order_MSG.Airmail = 'Yes' THEN
SET OutputRoot.XML.Book_Order_Response_MSG.Airmail = InputRoot.XML.Create_Book_Order_MSG.Airmail;
SET deliveryPrice = 8.00;
END IF;

DECLARE bookCount INTEGER;
DECLARE numBooks INTEGER;
DECLARE sumBookPrice DECIMAL 0;
SET bookCount = 1;
SET numBooks = CARDINALITY(InputRoot.XML.Create_Book_Order_MSG.Book_Details.ISBN[]);
WHILE bookCount<= numBooks DO
SET sumBookPrice = sumBookPrice + CAST(InputRoot.XML.Create_Book_Order_MSG.Book_Details.Book_Price[bookCount] AS DECIMAL);
SET OutputRoot.XML.Book_Order_Response_MSG.Book_Details[bookCount].ISBN = InputRoot.XML.Create_Book_Order_MSG.Book_Details.ISBN[bookCount];
SET OutputRoot.XML.Book_Order_Response_MSG.Book_Details[bookCount].Book_Price = InputRoot.XML.Create_Book_Order_MSG.Book_Details.Book_Price[bookCount];
SET bookCount = bookCount + 1;
END WHILE;

SET OutputRoot.XML.Book_Order_Response_MSG.Delivery_Price = deliveryPrice;
SET OutputRoot.XML.Book_Order_Response_MSG.Total_Price = sumBookPrice;
SET OutputRoot.XML.Book_Order_Response_MSG.Order_Status = 'Order Received';
-- CALL CopyEntireMessage();
PROPAGATE ;
PROPAGATE TO TERMINAL 'out1' ;

RETURN TRUE;
END;


Please Help me
Back to top
View user's profile Send private message Yahoo Messenger
pcelari
PostPosted: Fri Jun 15, 2007 6:56 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

to propagate to a terminal other than 'out', you have to return false.

...
PROPAGATE TO TERMINAL 'out1' ;
RETURN false;

Also why do you propagate twice?
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
kspranava
PostPosted: Fri Jun 15, 2007 7:06 am    Post subject: Reply with quote

Centurion

Joined: 27 Apr 2003
Posts: 124

Hi raghug,

Whats the exception?

As mentioned by pcelari, once propagation is successful, return false.

I assume, you are using two propagates intentionally. If not otherwise, set the delete clause of first propagate to none.

Excerpts from help:
If DELETE is set to DEFAULT, or the DELETE clause is absent, the output local environment, message, and exception list are all cleared and their memory recovered immediately after propagation.

Thanks,
kspranava.
Back to top
View user's profile Send private message
raghug
PostPosted: Fri Jun 15, 2007 7:07 am    Post subject: why do you propagate twice? Reply with quote

Acolyte

Joined: 19 Jul 2006
Posts: 60
Location: NJ

Thanks for u r replay

I need Multiple out put messages becouse ot that I used PROPAGET Statement


Thanks
WIN
Back to top
View user's profile Send private message Yahoo Messenger
pcelari
PostPosted: Fri Jun 15, 2007 7:18 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

you don't need explicit propagate for multiple output. why don't you just wire the same out terminal to multiple destinations?
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Fri Jun 15, 2007 8:13 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi raghug,

Irrespective of how many times you want to propagate, or what u actually want to achieve as per business logic, the exception must be becoz of the following
Code:
PROPAGATE ;
PROPAGATE TO TERMINAL 'out1' ;
After the first propagate, the msg tree has got deleted, thats why the second propagate is erroring out...

You should use DELETE NONE with your first propagate if you want to make another propagate WITHOUT creating the tree again...

Regards.
Back to top
View user's profile Send private message Send e-mail
raghug
PostPosted: Fri Jun 15, 2007 8:25 am    Post subject: Yes you are correct Reply with quote

Acolyte

Joined: 19 Jul 2006
Posts: 60
Location: NJ

Thanks for you and all help me
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem With PROPAGATE Statement
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.