|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  PassThru and single quotes | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | mmarq | 
		  
		    
			  
				 Posted: Sun Sep 29, 2002 3:17 pm    Post subject: PassThru and single quotes | 
				     | 
			   
			 
		   | 
		 
		
		   Acolyte
 
 Joined: 19 Sep 2002 Posts: 74 Location: Newton, MA 
  | 
		  
		    
			  
				If I have a select statement in a compute node as: 
 
 
 
Environment.Variables= PASSTHRU('select t.* from myTable 
 
where acctno = '123456789'
 
and pid = ? 
 
and substr(pid,3,4) not in ('7H6', '8h6', '8H2')', "InputBody"."PID"); 
 
 
I have two problems: 
 
 
The passthru statement thinks that the first single quote it sees is the end of the statement and then tries to evaluate 123456789. 
 
It also does not pass through as it should the "substr" statement which is a valid SQL statement (and is why I am using passthu). 
 
 
Thanks in advance, 
 
Melissa _________________ M Marquis | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kirani | 
		  
		    
			  
				 Posted: Sun Sep 29, 2002 8:43 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				Try this ..
 
   
	| Code: | 
   
  
	
 
Environment.Variables= PASSTHRU('select t.* from myTable 
 
where acctno = ? 
 
and pid = ? 
 
and substr(pid,3,4) not in (?, ?, ?)', '123456789',"InputBody"."PID",'7H6','8h6','8H2'); 
 
 | 
   
 
 _________________ 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 | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | Segs | 
		  
		    
			  
				 Posted: Tue Oct 01, 2002 11:34 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Voyager
 
 Joined: 04 Oct 2001 Posts: 78 Location: Zurich Financial Services 
  | 
		  
		    
			  
				| An alternative is to use '' instead of ' | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | gmabrito | 
		  
		    
			  
				 Posted: Fri Apr 18, 2003 1:15 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Apprentice
 
 Joined: 19 Mar 2002 Posts: 35
  
  | 
		  
		    
			  
				what about functions within Oracle that use the single quotes.
 
 
this doesn't work 
 
 
SET OutputRoot.XML[] = PASSTHRU('SELECT to_char(sysdate, ''YYYYMMDDHH24MISS'') from dual');
 
 
this doesn't work either 
 
 
SET OutputRoot.XML[] = PASSTHRU('SELECT ? FROM dual', "to_char(sysdate, 'YYYYMMDDHH24MISS')");
 
 
any help here would be appreciated.
 
 
Thanks, | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |