Improve SQL Expression Builder

2134
17
11-21-2018 07:52 AM
Status: Open
Labels (1)
MarcDyke2
New Contributor II

The existing SQL expression builder in ArcGIS Pro is very ponderous to use, especially for people familiar with SQL. Building one expression takes multiple mouse clicks which slows down the process. Unfortunately the 'Edit SQL mode' does not list fields and functions as it did in previous versions of ArcGIS.

 

Ms suggestions for improvements are:

 

  1. create an SQL expression builder similar to that which exists for the Label Class expression builder (and existed in previous versions of ArcGIS). It shows the fields that are available and some functions but the user is still free to type in the expression directly.
  2. if a layer or table is selected in the contents window then make that the target of the expression when the tool launches.
  3. enable select by attributes in a context menu on table windows and on layers and tables in the contents window.
17 Comments
KoryKramer

Thank you for submitting this (these) ideas, Marc Dyke‌.

3. Please go to Add Select by Attributes Tool to Attribute Table in ArcGIS Pro to add your vote and comments.

2.

if a layer or table is selected in the contents window then make that the target of the expression when the tool launches.

Don't we already do this?

1. So you just want to be able to see a list of fields and some functions like

as opposed to typing directly in the SQL box and using the intellisense, right?

MarcDyke2

For number 3, upvoted, thanks.

Ok, you got me on number 2 (I don't know why that wasn't the behavior I was seeing before).

For number 1, yes that is correct. I find the intellisense distracting and it does not provide any visual clues for field names and the like until you have already started typing. If the intelisense was enabled along with the list of fields and functions that would be fine but I would prefer to have the option to turn it off altogether.

KoryKramer

Thanks

MariePichlerGalarneau

I would love if inside the SQL definition query window included buttons and "Get Unique Values" like it did in ArcMap. I prefer writing queries in SQL, instead of using the dropdowns. But I feel that the SQL option is not user friendly. I just need to remember all the field names and their values perfectly in order to type them in, which is basically impossible. 

KoryKramer

It sounds like your idea is the same as https://community.esri.com/t5/arcgis-pro-ideas/improve-sql-expression-builder/idi-p/931226 and adds the request for a Get Unique Values button. 

I'll consult with the team on our side to see the best way to handle this. We may merge these...

wayfaringrob

I'll echo others' disappointment with Pro's SQL interface, well-documented here and other ideas. It sounds like some well-warranted reversions & revisions are in the works. ArcMap's SQL builder is rock solid. You get the same reliable, intuitive interface no matter where you are, and it gives one-click access to all fields, field values, and operators. Pro's dropdowns and "raw SQL" mode as I call it are really inefficient in comparison.

Another comment I'll make is that the textual operators (such as "is equal to" and "does not contain the text") are really slowing me down. Not only does it take a lot longer to read them, it takes longer for your brain to identify the differences and decide which one is appropriate -- not to mention, two clicks to get there.

Meanwhile, we all learned what '=' and '<' and so on mean in elementary math class. And in ArcMap's SQL builder, those symbols were there for us ready to be clicked and added into your expression.

Further, in Pro, Esri gives these newly verbose operators about a centimeter of horizontal space in most views, not modifiable unless you expand the whole pane:

rburkebsrc_0-1664224112862.png

That 'does,' for example, could be any of 4 options -- you don't know what your operator is without clicking on the dropdown or sitting there and waiting for a tooltip. I don't know who that's useful for. It takes a lot longer to figure out what's going on with an expression. I appreciate the attempt to make things easier on less SQL-fluent users (if that's what this is?), but this is just a step backwards in actual ease of use. I would rather just see the appropriate symbol included in the operator drop down, and for any operators that actually just slip a symbol into the search string, those % or () signs could just be included with the value (such as "%EXT" in my example,). The dropdown may still need to be expanded a bit to fit something like NOT LIKE. But that'd still be preferable to squeezing in longer phrases to a tiny box. OR, get rid of the set widths on the dropdowns. Keep each line a separate AND/OR but make the dropdowns as wide as their contents so that they read clearly as a sentence without clicking on any dropdowns (for there are cases where field title & value are longer than the box, too -- it's all stuck in a narrow pane, after all).

Like I said, we all know what '=, <, >' and all those symbols mean; for a new user to learn NOT LIKE and a few others is not too high of an expectation. I would love to have this revert to the way it was in ArcMap so I can get back to mapping with ease.

AlfredBaldenweck

Adding in some things I'd like to see, as well.

I'd like there to be better validation for SQL when writing queries in Pro (e.g. Definition Queries, Labelling Classes, etc.).

I'm trying to set up a complex query, and all that the editor tells me is "The SQL expression has invalid syntax".

I would like it to tell me where in the expression I have invalid syntax: at least the line number, if not the actual part of the expression throwing the error.

wayfaringrob

I'd also like to echo this sentiment:

I find the intellisense distracting and it does not provide any visual clues for field names and the like until you have already started typing. If the intelisense was enabled along with the list of fields and functions that would be fine but I would prefer to have the option to turn it off altogether.

If you're in SQL mode and have started typing, there is no way to back out of it and get to a list of fields without cancelling out and starting over. The definition query builder is in a modal box; without clickable fields, you must have an encyclopedic knowledge of your dataset to work this way. I've resorted to taking a screenshot of my attributes pane and keeping it open while I write which is a hugely inefficient step backwards compared to ArcMap.

wayfaringrob

The SQL builder found when importing locations to a network analyst solver also appears in need of TLC (this is the default window size):

rburke_0-1673385449371.png

Field mapping also is restrained to a small list of 5 properties even when resized, and the scroll wheel is disabled unless your cursor is perfectly over the scrollbar:

rburke_1-1673385504200.png