ArcGIS Pro 3.1.1
When creating a database view in a mobile geodatabase using the Create Database View geoprocessing tool:
The GP tool doesn't seem to allow SQL comments in the WITH clause (aka the CTE - Common Table Expression).
WITH cte AS (SELECT 1 as objectid ) --test SQL comment
SELECT * FROM cte
ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Underlying DBMS error[incomplete input]
DBMS table not found [DBMS table not found] [main.a_test_vw]
Whereas I can put comments elsewhere in the query, such as in the main SELECT:
WITH cte AS (SELECT 1 as objectid )
SELECT * FROM cte --test SQL comment
Is that a known issue?
Note: I don't have this problem when creating the view in the mobile GDB using a SQL Client like DBeaver. I only have the problem when creating the view in ArcGIS Pro.
Esri Case #03318359 - SQL comment in WITH clause in mobile GDB database view
(the title was changed afterwards to: ArcGIS Pro 3.1.1 - Comment within SQL Expression in View Definition parameter causes Create Database View GP tool to fail)
ENH-000158089: Request for support for trying comments within an SQL expression for the "View Definition" field in the "Create Database View" Geoprocessing tool