Select to view content in your preferred language

Select Layer by Location — Intersect (DBMS) — Show SQL query definition in GP tool details

337
0
01-02-2024 01:28 PM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

ArcGIS Pro 2.6.8; Oracle 18c 10.7.1 EGDB; SDE.ST_Geometry:

Background:

In the Select Layer By Location (Data Management) docs, the Relationship Parameter — Intersect (DBMS) section says:

For the Relationship parameter, the Intersect (DBMS) option may provide better performance than the Intersect option when using enterprise geodatabase data; however, this option is only supported under specific conditions. If all conditions are met, the spatial operation will be performed in the enterprise geodatabase database management system (DBMS) rather than on the client.

...The user connecting to the geodatabase must have privileges to create a view in the database where the feature classes are stored.

In other words, the tool creates a database view called SELECTIONOUTPUTNAME.

Bud_0-1704230226788.png

Bud_2-1704230226611.png

select "OBJECTID" from ( SELECT a.OBJECTID FROM INFRASTR.ACTIVE_TRANSPORTATION a,
INFRASTR.AGOL_PARKINGLOT b WHERE SDE.ST_INTERSECTS(a.SHAPE, b.SHAPE) = 1 ) esri_sql

 

Idea:

Rather than hide the SQL query definition in an obscure database view, allow the user to easily access the SQL by including the SQL as text in the GP tool details. Or something better.

Bud_4-1704230552265.png

Use Cases:

  1. Copy/paste the text for documentation purposes.
  2. Use the SQL elsewhere. Spatial SQL queries can be tricky to write from scratch, especially when using unfamiliar spatial types. It would be helpful to grab SQL from a working query and then modify it for other purposes.