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 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

00120: Query table has a complex query

  • Solution
  • More information

Your stand-alone table is a query table defined by a complex SQL query, and you are publishing a feature service to ArcGIS Server.

Solution

Do one of the following:

  • If editing is not required, publish a map service instead of a feature service.
  • If editing and, therefore, a feature service are required, simplify the SQL query defining your query layer by removing complex elements such as joins or WHERE clauses. An example of a simple query is as follows:
    SELECT id, city, population FROM mydb.myuser.city_stats
    
  • Alternatively, you can remove the stand-alone table if it is not needed.

More information

A query layer is a layer or stand-alone table that is defined by an SQL query. Query layers allow both spatial and nonspatial information stored in a DBMS to be easily integrated into GIS projects within ArcMap. Since query layers are using SQL to directly query database tables and views, spatial information used by a query layer is not required to be in a geodatabase.

When working in ArcMap, you create query layersby defining an SQL query. The query is then run against the tables and views in a database, and the result set is added to ArcMap as a layer or stand-alone table (depending on the query).

Publishing a feature service to ArcGIS Server requires that the SQL query defining the query table be simple. A common example would be as follows: SELECT * FROM Test.myuser.US_States. A simple query can contain a subset of the fields in the table, for example, SELECT objectid, pop2000, pop2010 FROM Test.myuser.US_States. WHERE clauses and joins are unsupported when publishing; for example, you cannot publish a query table where you are selecting a subset of rows in a simple query because it is controlled by the WHERE clause.

Learn more about authoring feature services for ArcGIS Server

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

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