Select to view content in your preferred language

How to "Define parameters in a query layer"?

511
3
07-11-2024 05:46 AM
nadja
by
Frequent Contributor

I'd like to incorporate this manual workflow into my dockpane,  but I don't find any useful documentation or samples. Does anyone know if it is possible and if yes, how it can be done?

my manual workflow:

I open an enterprise geodatabase feature class in a map in ArcGIS Pro. Then I open layer properties and go to source. there is the field "Query" (not definition query!) containing something like this "select attribute 1, attribute 2, ..., attribute n FROM layername".

nadja_swiss_parks_0-1720701997695.png

 

I then click on the pen on the right hand side and modify the query to "select * from layername". 

I found this documentation: https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/define-parameters-in-a-query-...

how can i add the layer such that its query says "select * from layername"? any help is greatly appreciated.

Tags (2)
0 Kudos
3 Replies
AlfredBaldenweck
MVP Regular Contributor

It sounds like you're asking how to make a Query Layer from Scratch?

If that's the case:

 

  1. Make sure an enterprise geodatabase connection is in your project's databases folder

    AlfredBaldenweck_1-1720702634806.png

     

  2. On the Map tab, hit the "Add Data" drop down and select "Query Layer"
    AlfredBaldenweck_2-1720702695516.png

     

  3. Choose your database connection
  4. Name your layer
  5. Write your Query
  6. Press Validate
  7. Hit Next
  8. Choose the unique ID
  9. Hit Finish

Query layers—ArcGIS Pro | Documentation

Create a query layer for data in a relational database—ArcGIS Pro | Documentation

0 Kudos
nadja
by
Frequent Contributor

thanks for your reply, but I'd like to do it using a arcpy-script. is that possible?

0 Kudos
AlfredBaldenweck
MVP Regular Contributor