Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 zagzebski
		
			zagzebski
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I need to automate the renaming of fields.
Table 1 and Table 2 are my fact tables. Beneath those is a transition table that would be used to rename the fields in some automated way...from the "Field" name to the "Master_Field" name. Although this is a simple example I have a project that will loop through 190 excel files and I need to rename the field names to the "Master_Field". Thanks for any help!
| Table 1: | |
| AgencyNum | Agency | 
| 1 | A | 
| 2 | B | 
| 3 | C | 
| 4 | D | 
| Table 2: | |
| AgencyNum2 | Agency2 | 
| 5 | E | 
| 6 | F | 
| 7 | G | 
| 8 | H | 
| Meta Data - Renaming Table: | |
| Field | Master_Field | 
| AgencyNum | AgencyNum | 
| Agency | Agency | 
| AgencyNum2 | AgencyNum | 
| Agency2 | Agency | 
 
					
				
		
 settu_periasamy
		
			settu_periasamy
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Have you read this How to Rename Fields
 zagzebski
		
			zagzebski
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks - I tried to do something like this but didn't work. I will see if I can make some modifications.
 
					
				
		
 settu_periasamy
		
			settu_periasamy
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Ok. you can check the comment section..
you can create the external file for all your fields ($Field) and map your master field.
 
					
				
		
load
field name as new name,
field name as new name,
field name as new name,
field name as new name
resident table name;
drop main table
try in this way
 
					
				
		
 jonathandienst
		
			jonathandienst
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I don't believe that you can rename multiple fields to the same target name. Once a field exists, you cannot rename another to have the same name. This is true for the simple rename field command and I expect that it is true for renaming with a mapping table.
 Peter_Cammaert
		
			Peter_Cammaert
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		And this is for a very simple reason: a RENAME outside of a LOAD will not join internal symbol tables. Would create a data mess anyway, with all those bit-stuffed pointers spread all over the place... 
