ArcGIS Pro 3.1.1; mobile geodatabase
Scenario: I try to create a database view, but I make a mistake in the SQL, so the view is invalid.
select * from test_tblx
ArcGIS Pro throws an error because the view is invalid:
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.
DBMS table not found [no such table: main.test_tblx] [test_vw6][STATE_ID = 0]
DBMS table not found [DBMS table not found] [main.test_vw6]
Failed to execute (CreateDatabaseView).
That error is expected.
However, if I refresh the mobile geodatabase in Catalog, I see that the view was actually created, despite the error. That's not expected.
Note: If the view was valid, then I wouldn't need to refresh the mobile geodatabase. The view would have shown up automatically without refreshing. But if the view is invalid, then I do need refresh the mobile geodatabase in order to see it.
Likewise, I can't add the broken view to the map:
Video:
Why does the view get created even if the SQL is invalid?
And if that behavior is expected for some reason, why doesn't Catalog automatically refresh the GDB to show the new view (like it would if the view was valid)?
Solved! Go to Solution.
Too funny, I just logged a defect on this issue a couple weeks ago: BUG-000157051 for ArcGIS Pro (esri.com)
Too funny, I just logged a defect on this issue a couple weeks ago: BUG-000157051 for ArcGIS Pro (esri.com)
Haha. Nice. Thanks.
From BUG-000157051:
...and the table view cannot be deleted.
That helps. I had noticed that certain views couldn't be deleted. I hadn't put my finger on what scenario lead to those undeletable views. Good to know.
Edit: I suppose Esri Support could add this post's URL to that bug report/case -- just as an added reference.
Also, FYI, here are a few other mobile GDB-related bugs I've found/submitted:
I've got a few other ENHs and open tickets related to mobile geodatabases too. I track that stuff in a Word doc, since my MyEsri account isn't linked to my organization's MyEsri account. So I could send that Word doc to you if needed.
The views that can't be deleted from ArcGIS Pro can be deleted from any SQLite tool just fine. They can't be deleted in ArcGIS Pro because they are created in SQLite but not populated in various GDB system tables, so the delete tools can't really figure out what to do. The solution to the delete issue is to have them never created in SQLite in the first place if the SQL is invalid.
It's a strange issue.
In comparison, if I create a valid view using a SQL client like DBeaver, then ArcGIS Pro can delete that view without issue. Even though it was created outside of ArcGIS Pro and so no system tables would have been updated.. But as you said, if ArcGIS Pro creates an invalid view, ArcGIS Pro can't delete that view.
It seems kind of inconsistent to me.