Select to view content in your preferred language

problem with Table to Table

1869
3
Jump to solution
09-21-2016 01:54 PM
KeithD1
Occasional Contributor

I've encountered a problem with the Table to Table tool. While attempting to copy a table from a Personal Geodatabase (.mdb) into an INFO workspace (directory), field names are truncated to 10 characters. I'm executing the tool via the python code below.

convInfoWrkspace = "E:/info_workspace_directory/" #directory representing an INFO workspace
convTempPGDBTblOut = "pgdb_tbl" #table in the personal geodatabase. table is in the ArcMap TOC
convInfoNameOut = "info_tble" #table to be created in INFO workspace

arcpy.env.workspace = convInfoWrkspace
arcpy.env.overwriteOutput = True
arcpy.TableToTable_conversion(convTempPGDBTblOut,convInfoWrkspace,convInfoNameOut)

Interestingly, and I think tellingly, when using the same tool via the GUI (ArcToolbox), it won't even allow me to export to an INFO workspace. Instead, it adds a .dbf extension and creates a .dbf table. And, being a .dbf, the field names are truncated to 10 characters. The instructions for the tool state that by removing the .dbf extension on the output table name, an INFO table is created...but I'm unable to remove the ".dbf" - it's instantly re-added.

One more thing...I noticed that in Arc\INFO, the fields with truncated names actually do list the un-truncated name as the "alternate_name".

I realize INFO is going the way of the dodo, but does anyone have any suggestions on how to preserve the original field name?

This is occurring with version 10.1 SP1 (Build 3143).

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

You are running into a fundamental limit of coverages: Fields (items) in coverage attribute tables.  The character limit is 16 characters, but the tools truncate at 10 to give some space for adding extra characters in case two fields share the same first 10 characters.  The alternate name, which is effectively an alias, contains the full name.

View solution in original post

3 Replies
JoshuaBixby
MVP Esteemed Contributor

You are running into a fundamental limit of coverages: Fields (items) in coverage attribute tables.  The character limit is 16 characters, but the tools truncate at 10 to give some space for adding extra characters in case two fields share the same first 10 characters.  The alternate name, which is effectively an alias, contains the full name.

DanPatterson_Retired
MVP Emeritus

don't know if it applies to raster or non-featureclass data but ValidateFieldName—Help | ArcGIS for Desktop 

and 10 characters is the limit, so you have to live within the bounds

KeithD1
Occasional Contributor

Hmmm, I was afraid of this response. So the original field names are 16 character, but ArcMap thinks it's going to protect me by truncating to 10?

What I think I'll do is simply warn the user of possible truncation and build some lines of AML code for them to paste into workstation to rename those fields to their original (up to 16 character) names. If they (read: me) fail to perform this extra step, it'll become obvious downstream when those fields are unavailable.

Thanks for the responses both of you!