ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

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
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Create Database View

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

Summary

Creates a view in a database based on an SQL expression.

Usage

  • The SQL expression used to define the view is validated by the database upon execution of the tool. Therefore, valid syntax for the view definition is determined by the underlying database. If the syntax is incorrect, an error message is returned.

  • This tool is supported for databases and enterprise geodatabases. File and personal geodatabases are not supported.

  • Views created in enterprise geodatabases using this tool are not registered with the geodatabase.

  • If a spatial column is included in the view, the geometry storage type of the column must be a SQL data type (such as ST_Geometry or Geometry), not a binary geometry storage type.

Syntax

CreateDatabaseView_management (input_database, view_name, view_definition)
ParameterExplanationData Type
input_database

The database that contains the tables or feature classes used to construct the view. This database is also where the view will be created.

Workspace
view_name

The name of the view that will be created in the database.

String
view_definition

An SQL statement used to construct the view.

String

Code sample

CreateDatabaseView example (Python window)

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

import arcpy
arcpy.CreateDatabaseView_management("c:/Connections/city_data.sde","trees","select objectid, owner, parcel from inventory where type = trees")

Environments

  • Current Workspace

Licensing information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the General toolset
  • Databases and ArcGIS

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

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

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal