  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			Casso 
			 
			
  
			
			
				Joined: 03 Jul 2008 Posts: 9 Country: Russian Federation | 
			 
			  
		 | 
		
			
				  Again code formatting | 
				     | 
			 
			
				Hello,
 
 
I have problem with code formatting tool
 
here is the source code
 
	  | 
	
 
	  | 
	DECLARE @aMonth int, @bMonth int, @cMonth int
 
set @aMonth = (select a_code from spr_month where a_id = 1)
 
set @bMonth= (select a_code from spr_month where a_id = 2)
 
set @cMonth= (select a_code from spr_month where a_id = 3) | 
	 
 
 
 
code after formatting
 
	  | 
	
 
	  | 
	DECLARE @aMonth int, @bMonth int, @cMonth int
 
SET @aMonth = (SELECT a_code 
 
               FROM   spr_month
 
               WHERE a_id = 1)
 
               SET @bMonth= (SELECT a_code 
 
                             FROM   spr_month
 
                             WHERE a_id = 2)
 
                             SET @cMonth= (SELECT a_code 
 
                                           FROM   spr_month
 
                                           WHERE a_id = 3) | 
	 
 
 
 
the problem is that the code after the ")"  don't start from the beginning
 
 
another problem
 
source:
 
	  | 
	
 
	  | 
	SELECT *
 
FROM aaa
 
INNER JOIN bbb
 
ON aaa.a = bbb.b
 
AND (aaa.a = 1 OR aaa.a = 2) 
 
INNER JOIN ccc
 
ON ccc.c = aaa.a | 
	 
 
 
 
formatted:
 
	  | 
	
 
	  | 
	SELECT * 
 
FROM aaa 
 
   INNER JOIN bbb
 
      ON aaa.a = bbb.b
 
      AND (aaa.a = 1
 
      OR aaa.a = 2) 
 
    
 
    INNER JOIN ccc
 
      ON ccc.c = aaa.a | 
	 
 
 
 
your tool add empty line between join's, and if i do format again it will be two empty lines... 
 
 
Sorry, i have bad English =(
  | 
			 
		  | 
	 
	
		| Thu Jul 03, 2008 6:41 am | 
		          | 
	 
	
		  | 
	 
	
		
			Casso 
			 
			
  
			
			
				Joined: 03 Jul 2008 Posts: 9 Country: Russian Federation | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				SQL Assistant v 3.5.21
 
 
select template
 
	  | 
	
 
	  | 
	SELECT ... AS ..., 
 
   ... = ..., 
 
   ( ... ) 
 
FROM ... AS ..., ... 
 
   JOIN ...
 
      ON ...
 
      ON ... = ...
 
      AND ...
 
      OR (...)
 
WHERE ... = ... 
 
   AND ... 
 
   OR (...) 
 
GROUP BY ..., ... 
 
HAVING ..., ...
 
ORDER BY ..., ... | 
	 
 
  | 
			 
		  | 
	 
	
		| Thu Jul 03, 2008 6:44 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				This looks like an issue with code formatter. For some reasons it treats consecutive SET = (query) as if they were subqueries. I am going to submit this issue to our bug tracking system. Hope it will be fixed in one of the following maintenance releases
 
  Last edited by SysOp on Thu Jul 03, 2008 9:32 am; edited 1 time in total | 
			 
		  | 
	 
	
		| Thu Jul 03, 2008 8:12 am | 
		          | 
	 
	
		  | 
	 
	
		
			Casso 
			 
			
  
			
			
				Joined: 03 Jul 2008 Posts: 9 Country: Russian Federation | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Thanks,
 
what about the second problem?
  | 
			 
		  | 
	 
	
		| Thu Jul 03, 2008 8:49 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				I submitted that too. I think that empty line is caused by the expression in brackets and line wrapping, not by the second INNER JOIN.
  | 
			 
		  | 
	 
	
		| Thu Jul 03, 2008 9:34 am | 
		          | 
	 
	
		  | 
	 
	
		
			Casso 
			 
			
  
			
			
				Joined: 03 Jul 2008 Posts: 9 Country: Russian Federation | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				The second join was added just to show new empty line =))
 
Thanks a lot
  | 
			 
		  | 
	 
	
		| Thu Jul 03, 2008 10:59 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
  | 
   
 
		 | 
	 
	  |