  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			ssandu 
			 
			
  
			
			
				Joined: 26 Feb 2007 Posts: 95 Country: Romania | 
			 
			  
		 | 
		
			
				  Code snippet question | 
				     | 
			 
			
				I have the following cose snippet
 
INSERT INTO $OBJECT$
 
    ($COLUMNS$)
 
SELECT $COLUMNS$
 
FROM $OBJECT$
 
WHERE |
 
When I run this and I select a table I get
 
INSERT INTO table
 
    (col1, (col2, (col3)
 
SELECT col1, col2, col3
 
FROM table
 
WHERE
 
How can I write this code snippet to get fields from insert command like (col1, col2, col3)
 
and to select another table in the select command.
 
Again I have to say that writing and saving Code snippets in SQL Assistant under Vista requires to run it AS Administrator.
 
Thank's
 
 
Sorin Sandu
 
Romania
  | 
			 
		  | 
	 
	
		| Sun May 04, 2008 3:20 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Just add spaces before and after the bracket. 
 
 
Note that anything that goes immediately before or after macro variable is considered as a prefix and repeated for every value, for example, if you want to create list of variables with names matching column names you can enter that as @$COLUMNS$. 
 
 
Anyway what you need is below.
 
 
 
	  | 
	
 
	  | 
	INSERT INTO $OBJECT$ 
 
( $COLUMNS$ ) 
 
SELECT $COLUMNS$ 
 
FROM $OBJECT$ 
 
WHERE |  | 
	 
 
  | 
			 
		  | 
	 
	
		| Sun May 04, 2008 10:32 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
  | 
   
 
		 | 
	 
	  |