  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			klwong 
			 
			
  
			
			
				Joined: 07 Mar 2009 Posts: 22 Country: Australia | 
			 
			  
		 | 
		
			
				  Saving database field name to file | 
				     | 
			 
			
				I am using the following command
 
 
DatabaseRetrieve
 
DatabaseSave
 
 
I got the results I wanted except I also like to include the field name of my results. Is there a command to do this ? If not, what is the most efficient way to do this ? Appreciate any assistance.
  | 
			 
		  | 
	 
	
		| Thu Jul 02, 2009 6:58 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				You would need to add them to the result as a the first row or concatenate after saving
 
DatabaseRetrieve "SELECT 'col1', 'col2', 'col3' UNION SELECT col1, col2, col3 FROM my_table", ...
 
 
Or save a static text file with column headers as you want to see them in the resulting file and then after DatabaseSave, execute
 
RunAndWait( "cmd /C copy headers.txt /A + saved_data.txt /A saved_data.txt", "target folder", 0, pid )
  | 
			 
		  | 
	 
	
		| Thu Jul 02, 2009 8:22 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
  | 
   
 
		 | 
	 
	  |