ArcGIS Pro 3.0.3; mobile geodatabase:
I want to put SQL comments in definition query SQL expressions. From my testing, these kinds of comments seem to work as expected:
Works: Multi-line SQL comments at the beginning or end of the SQL expression:
/*multi-line sql comment*/
OBJECTID IN (3, 5, 11)
OBJECTID IN (3, 5, 11)
/*multi-line sql comment*/
Works: Single-line SQL comments at the beginning of the SQL expression:
--single-line sql comment
OBJECTID IN (3, 5, 11)
Doesn't work: Single-line SQL comments at the end of the SQL expression:
OBJECTID IN (3, 5, 11)
--single-line sql comment
Error: The SQL expression has invalid syntax.
Question:
Why don't single-line comments work at the end of SQL expressions in ArcGIS Pro? Is that a bug?
I don't have that issue when creating full-blown SELECT queries in database views, query layers, or SQL Developer queries. I only seem to have that problem with ArcGIS Pro SQL expressions.
Note: There is a bug in ArcGIS Pro 3.0.3 that can be a nuisance: Modifying existing SQL expression disables definition query. So when testing things like the comments/SQL above, we need to re-enable definition queries after modifying the SQL.