| Author | 
		  Message
		 | 
		
		  | ramki | 
		  
		    
			  
				 Posted: Thu Mar 14, 2002 2:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 25 Sep 2001 Posts: 28
  
  | 
		  
		    
			  
				I am doing this in MQSI compute Node. For some reason I am getting the syntax error.
 
--DECLARE charnumDays INTERVAL;
 
DECLARE charnumDays INTEGER;
 
SET charnumDays  =  (CURRENT_DATE - DATE '1976-07-04') DAY;
 
 
Please advice me on this.
 
Thanks in Advance
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Thu Mar 14, 2002 3:03 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				Hmmmmm.
 
 
Cutting and pasting your code into a Compute node works fine on 2.02 with CSD2.
 
 
The answer is 9384.
 
 
Cheers,
 
 _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | ramki | 
		  
		    
			  
				 Posted: Thu Mar 14, 2002 3:27 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 25 Sep 2001 Posts: 28
  
  | 
		  
		    
			  
				So you mean to say it only works with 2.02 with CSD2. 
 
I am running here CSD01 ON MQSI 2.0.1
 
 
PLEASE LET ME KNOW IF THIS MAKES THE DIFFERENCE.
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Thu Mar 14, 2002 5:02 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Thu Mar 14, 2002 5:24 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				Just found this in U200162.TXT file for CSD4 of MQSI 2.0.1  
 
 
"IC29180 - THE INTERVAL DATETIME TYPE DOESN T WORK AS DOCUMENTED"
 
 
May be this is a known bug! Somone who is using MQSI 2.0.1 with CSD 1/2/3 can test this to their PC to make sure it is fixed in CSD4.
 
 
 
Kiran
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | ramki | 
		  
		    
			  
				 Posted: Mon Apr 08, 2002 12:32 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 25 Sep 2001 Posts: 28
  
  | 
		  
		    
			  
				yes this is the bug in MQSI  Version 2.0.1 . I used the below code 
 
SET intDAYS = (CAST (charCREATEDATE AS DATE) - dateSTARTDAYYEAR) DAY;
 
and deployed it ignoring the error and it worked fine in the runtime. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Miriam Kaestner | 
		  
		    
			  
				 Posted: Tue Apr 09, 2002 6:59 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 26 Jun 2001 Posts: 103 Location: IBM IT Education Services, Germany 
  | 
		  
		    
			  
				Your program snippet
 
--DECLARE charnumDays INTERVAL; 
 
DECLARE charnumDays INTEGER; 
 
SET charnumDays = (CURRENT_DATE - DATE '1976-07-04') DAY; 
 
 
can only only work with implicit CASTS, and these have changed inbetween releases.
 
So to be on the safe side, use either
 
DECLARE charnumDays INTERVAL; 
 
SET charnumDays = (CURRENT_DATE - DATE '1976-07-04') DAY; 
 
or
 
DECLARE charnumDays INTEGER; 
 
SET charnumDays = CAST((CURRENT_DATE - DATE '1976-07-04') DAY AS INTEGER); 
 
or
 
DECLARE charnumDays INTEGER; 
 
SET charnumDays = EXTRACT(DAY FROM (CURRENT_DATE - DATE '1976-07-04') DAY); 
 
 
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |