Query Table DataSource

Query table data source is a layer/table that is defined by a SQL query.

Referenced by: dataSource

Properties

Property Details
geometryType The geometry type. When querying a table that does not have a geometry column, do not include geometryType.
Valid values:
  • esriGeometryMultipoint
  • esriGeometryPoint
  • esriGeometryPolygon
  • esriGeometryPolyline
oidFields Comma separated list of identifier fields. There are only certain field types that can be used as a unique identifier. These field types include integer, string, GUID, and date. If a single integer field is specified, map server uses the values in that field directly to uniquely identify all features and rows returned from a queryTable. However, if a single string field or a group of fields is used as the unique identifier, map server maps those unique values to an integer.
query The SQL query.
spatialReference The spatial reference of the geometry column. When querying a table that does not have a geometry column, do not include spatialReference.
type String value indicating the type for the dataSource.
Valid value of this property queryTable
workspaceId The unique string value used to identify the datasource's workspace.

Example

{
  "type": "queryTable",
  "workspaceId": "SqlMAP",
  "oidFields": "taxlotid",
  "query": "SELECT * FROM TaxLots",
  "geometryType": "esriGeometryPolygon",
  "spatialReference": {
    "wkid": 4326
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close