<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Join to table with definition query — removing join breaks the layer in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1316593#M71893</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/342593"&gt;@JonathanNeal&lt;/a&gt;&amp;nbsp;might be interested in this.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Edit:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I tested in 3.1.2 just now and am still seeing the issue in that version.&lt;/P&gt;&lt;P&gt;I submitted an Esri Canada case this afternoon:&amp;nbsp;&lt;BR /&gt;03410020 -&amp;nbsp;ArcGIS Pro 3.1.2: Join to table with definition query — removing join breaks the layer&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2023 20:34:15 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2023-08-08T20:34:15Z</dc:date>
    <item>
      <title>Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1239924#M63256</link>
      <description>&lt;P&gt;ArcGIS Pro 3.0.3; mobile geodatabase:&lt;/P&gt;&lt;P&gt;I have a FC and a standalone table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1670683906172.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58206iEE562CB705345B27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1670683906172.png" alt="Bud_0-1670683906172.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I apply a definition query to the table -- to pare-down the rows so that only the latest inspection per asset is shown:&lt;/P&gt;&lt;PRE&gt;date_ = (select max(subq.date_) from roadinsptable subq where roadinsptable.asset_id = subq.asset_id)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1670684086225.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58207iEF3C39F06F35D14E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_1-1670684086225.png" alt="Bud_1-1670684086225.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I create a join from the FC to the table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_2-1670686086174.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58214i180243D8559E9E7A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_2-1670686086174.png" alt="Bud_2-1670686086174.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The join works as expected. And the definition query from the table is honoured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Later, I change my mind: I've determined I don't need the join, so I remove it:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_4-1670686251214.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58216iD17B6083CC303CB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_4-1670686251214.png" alt="Bud_4-1670686251214.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_5-1670686269941.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58217i1B9AD4E6E3C00DCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_5-1670686269941.png" alt="Bud_5-1670686269941.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Problem:&lt;/P&gt;&lt;P&gt;Removing the join causes an error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_6-1670686293327.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58218iE92F842D96CE95C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_6-1670686293327.png" alt="Bud_6-1670686293327.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;Failed to open table.&amp;nbsp;&lt;BR /&gt;Error:&lt;BR /&gt;Attribute column not found [no such column: date_]&lt;BR /&gt;[Roads][STATE_ID = 0]&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I hit OK. The attribute table of the FC automatically closes.&lt;/P&gt;&lt;P&gt;I try to re-open the attribute table of the FC:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_7-1670686426627.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58219i5B534951D66F761B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_7-1670686426627.png" alt="Bud_7-1670686426627.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But I get the same error I saw previously. And t&lt;SPAN&gt;he attribute table doesn't open. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_8-1670686450435.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58220i19F671113DCC4EB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_8-1670686450435.png" alt="Bud_8-1670686450435.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Trying again produces the same error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only way to successfully open the attribute table again is to remove the FC from the map and re-add it, which isn’t ideal.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is that a known issue?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I only have the problem when the join table has a definition query. If there's no definition query, then I can remove the join without getting the error.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 19:38:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1239924#M63256</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-08-08T19:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1240126#M63291</link>
      <description>&lt;P&gt;I have also run into this&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 13:53:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1240126#M63291</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2022-12-12T13:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1316537#M71885</link>
      <description>&lt;P&gt;ArcGIS Pro 3.1&lt;BR /&gt;I've run into a VERY similar issue (the same error message). My scenario is this:&lt;BR /&gt;Add a sqlite table to a map&lt;BR /&gt;Add a featureclass to the same map&lt;BR /&gt;Add a definition query on the sqlite table to limit the number of records&lt;BR /&gt;Join the featureclass (id field integer) to the sqlite table (id field integer)&lt;/P&gt;&lt;P&gt;The join works just fine, but when opening the attribute table of the featureclass (which is now joined to the sqlite table) Same error&lt;/P&gt;&lt;P&gt;"failed to open table.&lt;BR /&gt;Error:&lt;BR /&gt;Attribute column not found [no such column: 'name-of-the-first-column-used-in-the-sqlite-table-definition-query']&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 17:42:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1316537#M71885</guid>
      <dc:creator>eclecticlearner</dc:creator>
      <dc:date>2023-08-08T17:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1316593#M71893</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/342593"&gt;@JonathanNeal&lt;/a&gt;&amp;nbsp;might be interested in this.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Edit:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I tested in 3.1.2 just now and am still seeing the issue in that version.&lt;/P&gt;&lt;P&gt;I submitted an Esri Canada case this afternoon:&amp;nbsp;&lt;BR /&gt;03410020 -&amp;nbsp;ArcGIS Pro 3.1.2: Join to table with definition query — removing join breaks the layer&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 20:34:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1316593#M71893</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-08-08T20:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1316877#M71932</link>
      <description>&lt;P&gt;Thanks for replicating this issue&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/351335"&gt;@Bud&lt;/a&gt;&amp;nbsp;.&amp;nbsp; I am also using ArcGIS Pro 3.1.2.&lt;/P&gt;&lt;P&gt;I believe you mentioned&amp;nbsp;@JonathanNeal because of&amp;nbsp;&lt;A title="Does it matter if a definition on a join...." href="https://community.esri.com/t5/arcgis-pro-questions/does-it-matter-if-a-definition-query-on-a-join/td-p/1306971/jump-to/first-unread-message" target="_self"&gt;this&lt;/A&gt;&amp;nbsp; post.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Two likely scenarios come to mind in 3.1- and in ArcMap that you can mark as a YES:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. &lt;STRONG&gt;Subqueries do not work if done before the join on datasources with&lt;/STRONG&gt; &lt;EM&gt;&lt;STRONG&gt;"."&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The response by him strikes me as what could be the issue.&amp;nbsp; If ArcGIS Pro adds (as default behavior) sqlite/gpkg tables as a "query layer" then would a definition query on that query layer be treated as a subquery?&amp;nbsp; For reference I just drag and drop the tables into the map, sometimes I it asks for me to identify the uniqueID column but otherwise I've treated them no different than any other table when adding/removing etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;All of my sqlite tables show up in catalog pane as &lt;STRONG&gt;"main.mytablename"&lt;/STRONG&gt;.&amp;nbsp; For the life of me I have not figured out how to implement this in such a way that ArcPro drops the&amp;nbsp;&lt;STRONG&gt;"main."&lt;/STRONG&gt; It would be great if I could solve that part of the equation and see if it solves the definition query part of the equation.&lt;/P&gt;&lt;P&gt;Anyhow, thanks for the reply and hopefully this post gets some traction.&amp;nbsp; I have a tool I'm ready to implement but an error like this has me debating on rewriting the entire tool to output in some other way (I need outputs to be able to be read by more than just ESRI applications).&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 14:30:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1316877#M71932</guid>
      <dc:creator>eclecticlearner</dc:creator>
      <dc:date>2023-08-09T14:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1317145#M71953</link>
      <description>&lt;P&gt;Interesting.&lt;/P&gt;&lt;P&gt;Even if Esri doesn't plan to fix this issue:&amp;nbsp;&lt;EM&gt;&lt;U&gt;Subqueries do not work if done before the join on datasources with "."&lt;/U&gt;&lt;/EM&gt;&amp;nbsp;, at the very least, it shouldn't permanently break the layer (the join can't be removed). That should be fixed. And there should be helpful error messages to tell us what the problem is.&lt;/P&gt;&lt;P&gt;As I mentioned in a different post, &lt;U&gt;&lt;EM&gt;the measure of software quality is how good the error messages are&lt;/EM&gt;&lt;/U&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 20:40:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1317145#M71953</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-08-09T20:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1318199#M72037</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;From Esri Support in case #03410020 (open):&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I have followed the workflow you provided and was able to reproduce the issue you encountered. I'd like to share a few observations with you:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Apart from&amp;nbsp;removing&amp;nbsp;the FC from the map and then re-adding it, I found that I could open the attribute table again by removing the definition query in the FC that inherited from the definition query in the table&lt;UL&gt;&lt;LI&gt;This is an alternative approach to successfully opening the attribute table again&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;I attempted to apply a definition query in the default mode instead of the SQL mode and encountered no errors&lt;UL&gt;&lt;LI&gt;Upon further research on the "Attribute column not found" error, it seems that a possible cause is&amp;nbsp;the QueryDef object is not handling wild cards (*) for its SubFields property if there are fully qualified fields in any of the tables (for example AREA).&lt;/LI&gt;&lt;LI&gt;You can explore potential workarounds for this issue at&amp;nbsp;&lt;A href="https://support.esri.com/en-us/knowledge-base/error-attribute-column-not-found-000003383" target="_blank" rel="noopener"&gt;https://support.esri.com/en-us/knowledge-base/error-attribute-column-not-found-000003383&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sun, 13 Aug 2023 21:59:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1318199#M72037</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-08-13T21:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — removing join breaks the layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1323896#M72612</link>
      <description>&lt;P&gt;Esri Support reported the following bug for me:&lt;/P&gt;&lt;P&gt;BUG-000160924 : SQL query becomes case sensitive when a Feature Layer is joined to a table stored in a Mobile Geodatabase. After joining a feature layer and a table (both stored in a Mobile Geodatabase), SQL query becomes case sensitive and the previous SQL query expression fails to execute.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;might find this interesting.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 14:27:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-to-table-with-definition-query-removing-join/m-p/1323896#M72612</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-08-30T14:27:34Z</dc:date>
    </item>
  </channel>
</rss>

