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 ArcGIS Pro. 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 ArcGIS Pro, you create query layers by defining an SQL query. The query is then run against the tables and views in a database, and the result set is added to the map as a layer or stand-alone table (depending on the query).
The query is executed every time the layer is displayed or used in the map. This allows the latest information to be visible without making a copy or snapshot of the data and is especially useful when working with dynamic information that is frequently changing. The query layer's functionality works with any DBMS supported by ArcGIS.
Query layers allow ArcGIS Pro to integrate data from geodatabases as well as from DBMSs. Therefore, query layers can quickly integrate spatial and nonspatial information into GIS projects independently of where and how that information is stored.
A quick tour of working with query layers
- ArcGIS Pro users can add query layers to the map by defining a query against the tables and views in a DBMS.
- Query layers behave in the same way as other feature layers or stand-alone tables, so they can be used to display data, used as input to a geoprocessing tool, or accessed programmatically using developer APIs.