ArcGIS Pro 3.0.2: The “select by attributes” tool has “the expression can’t be edited in clause mode” issue when working with SQL option,

2561
7
05-10-2023 01:18 AM
JamalNUMAN
Legendary Contributor

ArcGIS Pro 3.0.2: The “select by attributes” tool has “the expression can’t be edited in clause mode” issue when working with SQL option,

 

As per the screenshot below, I couldn’t figure out why the “select by attributes” tool has “the expression can’t be edited in clause mode” issue when working with SQL option,

 

What might be the problem here?

 

Clip_28.jpg

 

Clip_28.jpg

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
7 Replies
BarryNorthey
Frequent Contributor

Try wrapping %school% in single quotes '%school%' not double quotes "%school%".

JamalNUMAN
Legendary Contributor

With same syntax, the obtained error message now makes sense as per the screenshot below. Why was the Pro giving the “the expression can’t be edited in clause mode” error that doesn't make any sense?

 

Clip_81.jpg

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
BarryNorthey
Frequent Contributor

When I built a selection query in clause mode it wrapped the target info I was looking for in single quotations, not double quotes and it turns red when displayed in SQL mode. In my example I am selecting anyone with initials J (text) in field INITIALS:

BarryNorthey_0-1684013313268.png

When I replace single quotes with double quotes in SQL mode and then try to return to clause mode I get the message you are getting and the entry in double quotes appears as black text.

BarryNorthey_1-1684013664825.png

 

I assume the warning “the expression can’t be edited in clause mode” is letting you know that you can't switch from SQL mode to clause mode as it doesn't recognize the syntax used (double quotes).

 

JamalNUMAN
Legendary Contributor

What’s meant by “clause mode”? how the script is recognized as “clause mode”?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
BarryNorthey
Frequent Contributor

Selection queries can be built in Clause mode or directly in SQL mode as explained here: https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/query-builder.htm

Queries built in Clause mode (interactive helper primarily for those that don't know how to structure a SQL query). It can be viewed in SQL mode by toggling BarryNorthey_0-1684605562824.pngmode to on. This is the actual SQL expression that Pro uses. You can also toggle SQL off and return to Clause mode.

You can also go directly to SQL mode directly and build your query but it is possible that the syntax you used is not recognized by Clause mode or there is an error that prevents opening clause mode, such as double quotes vs single quotes. (don't know).

 

 

PaulMason
New Contributor

I am also looking for an answer to this problem. It is a mode issue (as mentioned in the error message). So I just want to know how to restore the usual "Where..." mode so that I can select the Field, Operator, and enter a value. It would also be nice to know why this "clause" mode became active without me explicitly setting it?

0 Kudos
PaulMason
New Contributor

...excuse me, it IS in clause mode but it beats me why the SQL button is jammed and cannot be toggled. I guess the "Where" (with arguments) will appear when SQL is Off. 

0 Kudos