Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Conversion toolbox > To Geodatabase toolset > Tools

Table To Table (Conversion)

Release 9.2
Last modified April 2, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Converts an input table to a dBASE or a personal, file, or ArcSDE geodatabase table.


Usage tips

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.

Learn more about choosing and setting the output fields.

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
Data types for geoprocessing tool parameters


Command line example

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.

Learn more about choosing and setting the output fields.

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

Data types for geoprocessing tool parameters


Script example

# 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()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.