| Author | 
		  Message
		 | 
		
		  | veera_satya | 
		  
		    
			  
				 Posted: Wed Jun 16, 2010 5:47 pm    Post subject: doubt on select query | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 16 Jun 2010 Posts: 3
  
  | 
		  
		    
			  
				HI All,
 
 
      I need a small favour in esql coding.
 
 
I have a scenario to get the entire row from Environment selectively and store in a local varibale. I need to use this variable till this esql only for validation.
 
 
for example:
 
Set localVar[] = select * from Environment.Data.SCF_TABLE[] as S1
 
                      where S1.Feild1='CBS';
 
 
Can i use this as it is? or need to do any modification. Could you please suggest me.
 
 
Thanks,
 
Veera | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | veera_satya | 
		  
		    
			  
				 Posted: Wed Jun 16, 2010 6:22 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 16 Jun 2010 Posts: 3
  
  | 
		  
		    
			  
				Any suggessions please. I am able to retrieve single value from entire row.
 
Set localVar = select ITEM S1.SCFCODE from Environment.Data.SCF_TABLE[] as S1 
 
where S1.Feild1='CBS'; 
 
 
Because this is single value. But i am not able to proceed with the below requirement. Any body can suggest me please.
 
 
Thanks,
 
veera | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | veera_satya | 
		  
		    
			  
				 Posted: Wed Jun 16, 2010 7:58 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 16 Jun 2010 Posts: 3
  
  | 
		  
		    
			  
				for single value: 
 
 
It is working for getting single value
 
Set localVar = THE(select ITEM S1.SCFCODE from Environment.Data.SCF_TABLE[] as S1 
 
where S1.Feild1='CBS'); 
 
 
For retrieving whole row:
 
 
This is not working
 
Set envRef.Data.Temp[] = select * from Environment.Data.SCF_TABLE[] as S1 
 
where S1.Feild1='CBS'; 
 
 
 
Could you please suggest me how to proceed for getting whole row. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kimbert | 
		  
		    
			  
				 Posted: Wed Jun 16, 2010 11:57 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 Location: Southampton 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| I need to use this variable till this esql only for validation. | 
   
 
Please describe this 'validation'?
 
 
   
	| Quote: | 
   
  
	| This is not working  | 
   
 
   Those words should be banned on this forum. Please describe the problem properly, or else don't mention it at all.
 
 
   
	| Quote: | 
   
  
	| Could you please suggest me how to proceed for getting whole row | 
   
 
What do you mean by 'whole row'? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Thu Jun 17, 2010 2:20 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				One of your two ESQL Select statements is proper ESQL syntax.
 
 
One of them is not. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sushilishere | 
		  
		    
			  
				 Posted: Sun Jun 20, 2010 11:06 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 27 Jul 2008 Posts: 36
  
  | 
		  
		    
			  
				Is it throwing an exception or is it not selecting any values!!
 
 
Kindly elaborate!!
 
 
The select statement over any Row type variable is valid.
 
 
Suggestion : Do not use * . Specify all the column names. ( kinda followed as best practice in my place   ) 
 
Example : 
 
SET Environment.Variable.SelectAttack[] = Select 
 
		InputRoot.MRM.localElement2.localElement1
 
		from InputRoot.MRM.localElement2[] AS IES where InputRoot.MRM.localElement2.localElement.localElement1='100';
 
 
 
 
This was _________________ ----------------------------
 
IBM MQ v6.0 Sys Admin
 
IBM MBv6.0 Sol Desgnr
 
----------------------------------------------------
 
By the Mountain Side.. looking at the Great Divide
 
---------------------------------------------------- | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |