Create Table (Data Management)

Summary

Creates a geodatabase table or a dBASE table.

Usage

  • To create a dBASE table in a folder, you must append a .dbf extension to the Table Name parameter value.

Parameters

LabelExplanationData Type
Table Location

The workspace in which the output table will be created.

Workspace
Table Name

The name of the table to be created.

String
Template Table Name
(Optional)

A table with an attribute schema that is used to define the output table. Fields in the template table will be added to the output table.

Table View
Configuration Keyword
(Optional)

The configuration keyword that determines the storage parameters of the table in an enterprise geodatabase.

String
Table Alias Name
(Optional)

The alternate name of the output table that will be created.

String

Derived Output

LabelExplanationData Type
Output Table

The new output table.

Table

arcpy.management.CreateTable(out_path, out_name, {template}, {config_keyword}, {out_alias})
NameExplanationData Type
out_path

The workspace in which the output table will be created.

Workspace
out_name

The name of the table to be created.

String
template
[template,...]
(Optional)

A table with an attribute schema that is used to define the output table. Fields in the template table will be added to the output table.

Table View
config_keyword
(Optional)

The configuration keyword that determines the storage parameters of the table in an enterprise geodatabase.

String
out_alias
(Optional)

The alternate name of the output table that will be created.

String

Derived Output

NameExplanationData Type
out_table

The new output table.

Table

Code sample

CreateTable example 1 (Python window)

The following Python window script demonstrates how to use the CreateTable function in immediate mode.


import arcpy
arcpy.env.workspace = "C:/data"
arcpy.management.CreateTable("C:/output", "habitatTemperatures.dbf", 
                             "vegtable.dbf")
CreateTable example 2 (stand-alone script)

The following Python script demonstrates how to use the CreateTable function in a stand-alone script:


# Name: CreateTable_Example2.py
# Description: Create table to store temperature data in gnatcatcher habitat areas

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/data"

# Set local variables
out_path = "C:/output"
out_name = "habitatTemperatures.dbf"
template = "vegtable.dbf"
config_keyword = ""

# Run CreateTable
arcpy.management.CreateTable(out_path, out_name, template, config_keyword)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics