Table to Table (Conversion)

License Level:BasicStandardAdvanced

Summary

Converts an input table to a dBASE or geodatabase table.

Usage

Syntax

TableToTable_conversion (in_rows, out_path, out_name, {where_clause}, {field_mapping}, {config_keyword})
ParameterExplanationData Type
in_rows

The input table to be converted to a new table.

Table View; Raster Layer
out_path

The destination where the output table will be written.

Workspace
out_name

The name of the output table.

If the Output Location is a folder, convert the Input Rows to a dBASE table by specifying a name with the extension .dbf, or convert the Input Rows to a INFO table by specifying a name with no extension. If the Output Location is a geodatabase, convert the Input Rows to a geodatabase table by specifying a name with no extension.

String
where_clause
(Optional)

An SQL expression used to select a subset of records. For more information on SQL syntax see the help topic SQL reference for query expressions used in ArcGIS.

SQL Expression
field_mapping
(Optional)

The fields and field contents chosen from the input table. You can add, rename, or delete output fields as well as set properties such as data type and merge rule.

Learn more about choosing and setting the output fields.

Field Mappings
config_keyword
(Optional)

Specifies the default storage parameters (configurations) for geodatabases in a relational database management system (RDBMS). This setting is applicable only when using SDE geodatabase tables.

ArcSDE configuration keywords are set by the database administrator.

String

Code Sample

TableToTable Example (Python Window)

The following Python window script demonstrates how to use the TableToTable tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.TableToTable_conversion("vegtable.dbf", "C:/output/output.gdb", "vegtable")
TableToTable Example (stand-alone Python script)

The following stand-alone script demonstrates how to use the TableToTable tool.

# Name: TableToTable_Example2.py
# Description: Use TableToTable with an expression to create a subset
#  of the original table.
 
# Import system modules
import arcpy
from arcpy import env
 
# Set environment settings
env.workspace = "C:/data"
 
# Set local variables
inTable = "vegtable.dbf"
outLocation = "C:/output/output.gdb"
outTable = "estuarine"

# Set the expression, with help from the AddFieldDelimiters function to select the appropriate field delimiters for the data type
expression = arcpy.AddFieldDelimiters(env.workspace, "VEG_TYPE") + " = 'Estuarine'"
 
# Execute TableToTable
arcpy.TableToTable_conversion(inTable, outLocation, outTable, expression)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
3/3/2014