|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  Database is not updating | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | mq_series | 
		  
		    
			  
				 Posted: Wed Feb 26, 2003 3:52 am    Post subject: Database is not updating | 
				     | 
			   
			 
		   | 
		 
		
		   Apprentice
 
 Joined: 29 Oct 2001 Posts: 30
  
  | 
		  
		    
			  
				Hi friends,
 
 
I tried running the sample given in "Developing soln with MQIntegrator". I downloaded the sample material from Ibm site.
 
The message flow BookReservation was not running initially but after doing some modifications in ESQL and after removing the plugin java node I am able to process the input message and recieve output message but somehow the database tables are not getting updated.Though ESQL for database updation is in place.
 
 
I am using MQSI 2.1 CSD02 and now CSD04.
 
MQseries 5.3 
 
DB2 7.2
 
 
All are on Win NT.
 
 
Some of you please advice on this.
 
 
Regards
 
 
Rajeev | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kirani | 
		  
		    
			  
				 Posted: Thu Feb 27, 2003 10:10 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				Is there any exception thrown when updating db? 
 
   
	| mq_series wrote: | 
   
  
	
 
....and after removing the plugin java node...
 
 | 
   
 
 
could you pls explain this? _________________ Kiran
 
 
 
IBM Cert. Solution Designer & System Administrator - WBIMB V5
 
IBM Cert. Solutions Expert - WMQI
 
IBM Cert. Specialist - WMQI, MQSeries
 
IBM Cert. Developer - MQSeries
 
 
 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | mq_series | 
		  
		    
			  
				 Posted: Sun Mar 02, 2003 10:30 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Apprentice
 
 Joined: 29 Oct 2001 Posts: 30
  
  | 
		  
		    
			  
				Thank you very much  Kirani for your kindness .
 
I am reffering to message flow "BookReservation" .
 
 
In this  messageflow the message flows to a 'Database' node and then to a compute node. I have connected a single trace node to both the o/p  terminals of the database node.After looking at the trace it shows that the Environment tree only has one element and that is passenger.Does it mean that none of the select query is working .Is there any other way to check the execution of ESQL statement at runtime ???.The ESQL statements to be executed in Database node are as follows. 
 
I have checked that none of the SQL query of this particular node is executed successfully.
 
 
ESQL Statement in Database node
 
 
 
DECLARE TotPass INTEGER;
 
 
SET TotPass=CARDINALITY(Body.PassengerReservationRequest.ListOfPassengers.*[]);
 
 
SET Environment.Variables = THE (SELECT FLIGHTTB.* FROM Database.RVERMA.FLIGHTTB  
 
                            WHERE  FLIGHTTB.FLIGHTDATE = Body.PassengerReservationRequest.Flight.Date AND 
 
                            FLIGHTTB.FLIGHTNO   = Body.PassengerReservationRequest.Flight.Number); 
 
 
SET Environment.Variables.EconomyClassRemain = CAST (Environment.Variables.TOTALECONOMIC AS INTEGER) - 
 
                                               CAST (Environment.Variables.ECONOMICCLASS AS INTEGER);
 
SET Environment.Variables.FirstClassRemain   = CAST (Environment.Variables.TOTALFIRST    AS INTEGER) - 
 
                                               CAST (Environment.Variables.FIRSTCLASS    AS INTEGER);
 
DECLARE ref REFERENCE TO Body.PassengerReservationRequest.ListOfPassengers.Passenger[1];
 
 
SET Environment.Variables.NoPassengers = 0;
 
 
While LASTMOVE(ref) 
 
DO  
 
  IF ref.Class = 'F'
 
   then  
 
       if Environment.Variables.FirstClassRemain >=1
 
          then
 
             SET  Environment.Variables.FirstClassRemain = Environment.Variables.FirstClassRemain - 1;
 
             SET  Environment.Variables.FIRSTCLASS       = Environment.Variables.FIRSTCLASS       + 1; 
 
             SET  Environment.Variables.NoPassengers     = Environment.Variables.NoPassengers     + 1;
 
        end if;
 
   else
 
       if Environment.Variables.EconomyClassRemain >=1
 
          then
 
             SET  Environment.Variables.EconomyClassRemain = Environment.Variables.EconomyClassRemain - 1;
 
             SET  Environment.Variables.ECONOMICCLASS      = Environment.Variables.ECONOMICCLASS      + 1; 
 
             SET  Environment.Variables.NoPassengers       = Environment.Variables.NoPassengers     + 1;
 
        end if;
 
end if;
 
MOVE ref NEXTSIBLING ;
 
end while;
 
 
SET Environment.Variables.NoPassengers = 4;
 
 
If TotPass > Environment.Variables.NoPassengers
 
   then 
 
   THROW USER EXCEPTION MESSAGE 2949 VALUES('Number of passengers exceeds capacity');
 
end if;
 
 
UPDATE Database.RVERMA.FLIGHTTB AS T
 
       SET ECONOMICCLASS = Environment.Variables.ECONOMICCLASS, 
 
           FIRSTCLASS    = Environment.Variables.FIRSTCLASS
 
       WHERE  T.FLIGHTDATE = Body.PassengerReservationRequest.Flight.Date AND 
 
              T.FLIGHTNO   = Body.PassengerReservationRequest.Flight.Number; 
 
 
 
After Database node the flow enters a compute node somehow all ESQL statements in this node are working correctly including database node after a minor modification.The modified ESQL of this node is as follows.
 
 
SET OutputRoot = InputRoot;
 
-- Enter SQL below this line.  SQL above this line might be regenerated, causing any modifications to be lost.
 
DECLARE I INTEGER;
 
SET I = 1;
 
while I <= Environment.Variables.NoPassengers 
 
DO  
 
SET Environment.Variables.RESERVATIONSEQNO = Environment.Variables.RESERVATIONSEQNO + 1; 
 
INSERT INTO Database.RVERMA.PASSENGERTB (LASTNAME,FIRSTNAME,FLIGHTNO,FLIGHTDATE,CLASSTYPE,RESERVATIONNO)
 
                           VALUES(InputBody.PassengerReservationRequest.ListOfPassengers.Passenger[I].LastName,
 
                                  InputBody.PassengerReservationRequest.ListOfPassengers.Passenger[I].FirstName,
 
                                  InputBody.PassengerReservationRequest.Flight.Number,
 
                                  InputBody.PassengerReservationRequest.Flight.Date,
 
                                  InputBody.PassengerReservationRequest.ListOfPassengers.Passenger[I].Class,
 
                                  (InputBody.PassengerReservationRequest.Flight.Number || 
 
                                   InputBody.PassengerReservationRequest.Flight.Date || 
 
				   CAST (I AS CHAR)));
 
SET OutputRoot.XML.PassengerReservationRequest.ListOfPassengers.Passenger[I].ReservationNO = 
 
    (InputBody.PassengerReservationRequest.Flight.Number || 
 
     InputBody.PassengerReservationRequest.Flight.Date || 
 
     CAST (Environment.Variables.RESERVATIONSEQNO AS CHAR));
 
SET I  = I + 1;
 
end while;
 
--UPDATE Database.RVERMA.FLIGHTTB AS T
 
--       SET ECONOMICCLASS = Environment.Variables.ECONOMICCLASS, 
 
--           FIRSTCLASS    = Environment.Variables.FIRSTCLASS
 
--       WHERE  T.FLIGHTDATE = Body.PassengerReservationRequest.Flight.Date AND 
 
--              T.FLIGHTNO   = Body.PassengerReservationRequest.Flight.Number; 
 
 
UPDATE Database.RVERMA.FLIGHTTB AS T
 
	SET RESERVATIONSEQNO = I
 
--       SET RESERVATIONSEQNO = Environment.Variables.RESERVATIONSEQNO; 
 
WHERE  T.FLIGHTDATE = InputBody.PassengerReservationRequest.Flight.Date AND 
 
              T.FLIGHTNO   = InputBody.PassengerReservationRequest.Flight.Number; | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | mq_series | 
		  
		    
			  
				 Posted: Mon Mar 03, 2003 12:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Apprentice
 
 Joined: 29 Oct 2001 Posts: 30
  
  | 
		  
		    
			  
				My Friend Kirani,
 
 
When I changed the ESQL of Database node from
 
 
SET Environment.Variables = THE (SELECT FLIGHTTB.* FROM Database.RVERMA.FLIGHTTB 
 
WHERE FLIGHTTB.FLIGHTDATE = Body.PassengerReservationRequest.Flight.Date AND 
 
FLIGHTTB.FLIGHTNO = Body.PassengerReservationRequest.Flight.Number); 
 
 
 TO 
 
 
SET Environment.Variables = THE (SELECT D1.* FROM Database.RVERMA.FLIGHTTB AS D1
 
WHERE D1.FLIGHTDATE = Body.PassengerReservationRequest.Flight.Date AND 
 
D1.FLIGHTNO = Body.PassengerReservationRequest.Flight.Number); 
 
 
 
Then everything worked fine. I donot understand whether its a bug or problems specific to my installation ?????????.Any ways Thank you again for your attention.
 
 
Regards
 
 
Rajeev | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |