ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Create File GDB

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a file geodatabase in a folder.

Usage

  • The output path must already exist.

  • If the output geodatabase name does not include a .gdb extension, one will be added.

Syntax

CreateFileGDB(out_folder_path, out_name, {out_version})
ParameterExplanationData Type
out_folder_path

The folder where the file geodatabase will be created.

Folder
out_name

The name of the file geodatabase to be created.

String
out_version
(Optional)

The ArcGIS version for the new geodatabase.

  • CURRENT —Creates a geodatabase compatible with the currently installed version of ArcGIS. This is the default.
  • 10.0 —Creates a geodatabase compatible with ArcGIS version 10.
  • 9.3 —Creates a geodatabase compatible with ArcGIS version 9.3.
  • 9.2 —Creates a geodatabase compatible with ArcGIS version 9.2.
String

Derived Output

NameExplanationData Type
out_file_gdb

The new output file geodatabase.

Workspace

Code sample

CreateFileGDB example 1 (Python window)

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

import arcpy
arcpy.CreateFileGDB_management("C:/output", "fGDB.gdb")
CreateFileGDB example 2 (Python window)

The following Python window script demonstrates how to use the CreateFileGDB function in immediate mode to create a file geodatabase corresponding to a previous release of ArcGIS.

import arcpy
arcpy.CreateFileGDB_management("C:/output", "fGDB.gdb", "9.2")
CreateFileGDB example 3 (stand-alone script)

The following Python script demonstrates how to use the CreateFileGDB function in a stand-alone script.

# Name: CreateFileGDB_Example2.py
# Description: Create a file GDB

# Import system modules
import arcpy

# Set local variables
out_folder_path = "C:/output" 
out_name = "fGDB.gdb"

# Execute CreateFileGDB
arcpy.CreateFileGDB_management(out_folder_path, out_name)

Environments

  • Current Workspace
  • Scratch Workspace

Licensing information

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

Related topics

  • An overview of the Workspace toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal