  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			liangzhu 
			 
			
  
			
			
				Joined: 30 Nov 2011 Posts: 42 Country: Singapore | 
			 
			  
		 | 
		
			
				  null string compared with number and sql account status | 
				     | 
			 
			
				hi, thanks in advance...
 
 
1. if i do this:
 
 
	  | 
	
 
	  | 
	dim snull, string, ""
 
dim ssource, string, "12342"
 
dim bequal, boolean
 
 
isequal ssource,snull, bequal
 
ifthen bequal, theend1
 
 
theend1: | 
	 
 
 
 
i will get "type mismatch". i was actually using gettoken to go through a line, and using "" to know that there are no more tokens. however, some of the tokens are numbers("12342") and some of them are strings("onefive"), and i run into this type mismatch problem.
 
is there a way around this?
 
 
2. roughly, how can i use JAL or the SQL statements functions in 24x7 to see if a sql account(mssql express) is locked?
  | 
			 
		  | 
	 
	
		| Tue Mar 13, 2012 11:20 pm | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Hi,
 
 
Data type declarations are a mostly legacy thing in JAL. When comparing 2 variables, it compares their actual values. To prevent issues with numeric values, before comparison prefix both values by some alpha symbol, for example,
 
 
	  | 
	
 
	  | 
	Concat "x", snull, x_snull
 
Concat "x", ssource, x_ssource
 
isEqual x_snull, x_ssource, bequal
 
... | 
	 
 
  | 
			 
		  | 
	 
	
		| Wed Mar 14, 2012 12:24 am | 
		          | 
	 
	
		  | 
	 
	
		
			liangzhu 
			 
			
  
			
			
				Joined: 30 Nov 2011 Posts: 42 Country: Singapore | 
			 
			  
		 | 
		
			
				  thanks! | 
				     | 
			 
			
				um..the other thing is i'd really like to be able to run, lets say,
 
 
SELECT LOGINPROPERTY('loginname', 'IsLocked')
 
 
and assign the result of that to a variable in JAL.
 
 
is it possible to do that?
 
 
Thanks again!
  | 
			 
		  | 
	 
	
		| Wed Mar 14, 2012 2:45 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Do you mean a database command? It is sure possible
 
 
	  | 
	
 
	  | 
	// connect to database
 
DatabaseConnect( ... profile_name_here... )
 
// run query
 
DatabaseRetrieve( "SELECT ...", rows )
 
// get the value of first row, first column
 
DatabaseGet( 1, 1, my_var )
 
// disconnect
 
DatabaseDisconnect( ) | 
	 
 
  | 
			 
		  | 
	 
	
		| Wed Mar 14, 2012 8:09 am | 
		          | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
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
  | 
   
 
		 | 
	 
	  |