Table To Table (Conversion) |
|
Release 9.2
Last modified April 2, 2008 |
![]() ![]() ![]() Print all topics in : "Tools" |
Converts an input table to a dBASE or a personal, file, or ArcSDE geodatabase table.
Usage tips
The inputs can include dBASE, INFO, VPF, OLE DB, or geodatabase tables. The inputs can also be table views.
To drop fields during the conversion, delete input fields from the Field Map. This will not affect the input table.
If the input is a table view with a selection, only those rows that are selected will be transferred to the output.
Output fields and their contents can be controlled by the Field Map option.
The order in which you select fields determines the order in which their values will be displayed in the output field. When joining several input fields into a single output field, the output fields' values will be generated based on the order the input fields were chosen.
A new output field can be added to the output table, composed of user-specified input fields.
A single output field can be generated from multiple input fields. This happens, if more than one input table contains a field of the same name, or it can happen, if a new field is created and the contents of the output field are generated from multiple (differently named) user-selected fields.
The first input tables' fields will appear first as sub fields in the Field Map.
The data type of an output field will default to the same as the data type of the first input field (of that name) it encounters. The data type may be changed manually at any time to any valid data type. All valid data types will be listed if the tools dialog box is used.
When using the Merge rule, you can specify your own delimiter such as a space, comma, period, dash, and so on. If you want to use a space, make sure your mouse pointer is at the start of the input box and click the space bar once.
Concatenation can happen only if the fields chosen are from the same input table.
There are a number of Merge rules available: first, last, join, sum, mean, median, min, max and standard deviation.
Format options are only available on input fields of type text (and in conjunction with the Join merge rule). You can specify start point, end point, and so on. Format allows you to apply your changes to the selected input field or to apply them to all occurrences of the same input field.
Standard deviation should not be performed on a single input because values can't be divided by zero, so standard deviation is not a valid option for single inputs. The Merge tool, however, will not fail if standard deviation is chosen for an output field that only has a single input field. In this instance, a value of zero (0) will be entered in the rows of the output field.
The configuration keyword specifies the default storage parameters (configurations) for geodatabases in a relational database management system (RDBMS). This setting is applicable only when using ArcSDE. For more on configuration keyword, see CONFIG keyword.
The following environment affect this tool: configKeyword
Command line syntax
An overview of the Command Line window
TableToTable_conversion <in_rows> <out_path> <out_name> {where_clause} {field_mapping} {config_keyword}
Parameter | Explanation | Data Type |
<in_rows> |
The input dBASE, INFO, OLE DB, or geodatabase table. |
Table View | Raster Layer |
<out_path> |
This can be a geodatabase or a folder. If the output location is a folder, the output table will be a dBASE table. |
Workspace | Feature Dataset |
<out_name> |
The name of the output table. |
String |
{where_clause} |
An SQL expression used to select a subset of records. The syntax for the expression differs slightly depending on the data source. For example, if you're querying file or ArcSDE geodatabases, dBASE or INFO tables, enclose field names in double quotes: "MY_FIELD" If you're querying personal geodatabases, enclose fields in square brackets: [MY_FIELD]. For more information on SQL syntax and how it differs between data sources, see SQL Reference. |
SQL Expression |
{field_mapping} |
The fields and field contents chosen from the inputs. Each of the unique input fields will be listed on the Field Map window and when expanded, you will see a list of all the input field occurrences (sub fields). New fields can also be added. For each Field Map, you can add, rename, or delete output fields as well as set properties such as data type and merge rule. You can also delete an output field's sub fields, and you can format any output field's values if the data type is text. |
Field Mappings |
{config_keyword} |
Specifies the storage parameters (configuration) for geodatabases in file and ArcSDE geodatabases. Personal and file geodatabases do not use configuration keywords. ArcSDE configuration keywords are set up by your database administrator. |
String |
TableToTable c:\gis\mytable.dbf c:\gis\gdb.mdb mytable ("CONDITION" = 'arid')
Scripting syntax
About getting started with writing geoprocessing scripts
TableToTable_conversion (in_rows, out_path, out_name, where_clause, field_mapping, config_keyword)
Parameter | Explanation | Data Type |
in_rows (Required) |
The input dBASE, INFO, OLE DB, or geodatabase table. |
Table View | Raster Layer |
out_path (Required) |
This can be a geodatabase or a folder. If the output location is a folder, the output table will be a dBASE table. |
Workspace | Feature Dataset |
out_name (Required) |
The name of the output table. |
String |
where_clause (Optional) |
An SQL expression used to select a subset of records. The syntax for the expression differs slightly depending on the data source. For example, if you're querying file or ArcSDE geodatabases, dBASE or INFO tables, enclose field names in double quotes: "MY_FIELD" If you're querying personal geodatabases, enclose fields in square brackets: [MY_FIELD]. For more information on SQL syntax and how it differs between data sources, see SQL Reference. |
SQL Expression |
field_mapping (Optional) |
The fields and field contents chosen from the inputs. Each of the unique input fields will be listed on the Field Map window and when expanded, you will see a list of all the input field occurrences (sub fields). New fields can also be added. For each Field Map, you can add, rename, or delete output fields as well as set properties such as data type and merge rule. You can also delete an output field's sub fields, and you can format any output field's values if the data type is text. |
Field Mappings |
config_keyword (Optional) |
Specifies the storage parameters (configuration) for geodatabases in file and ArcSDE geodatabases. Personal and file geodatabases do not use configuration keywords. ArcSDE configuration keywords are set up by your database administrator. |
String |
# TableToTableExample.py # Description: Converts a dBASE file to a geodatabase # Requirement: None # Author: ESRI # Date: 12/12/03 # Create the Geoprocessor object import arcgisscripting gp = arcgisscripting.create() # Set some local variables inTable = "C:/data/myDBase.dbf" outLocation = "C:/data/myPGDB.mdb" outTableName = "myGDBTable" expression = " \"LINK_CHARS\" = \'four\' " # Use error trapping in case an error occurs during conversion try: # Process: Table To Table... gp.TableToTable_conversion(inTable, outLocation, outTableName, expression) except: print "An error occurred" print gp.GetMessages()