<?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 List of FCs that meet certain SQL criteria in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/list-of-fcs-that-meet-certain-sql-criteria/m-p/1347170#M69190</link>
    <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 2.6.8; Oracle 18c; 10.7.1 EGDB; SDE.ST_GEOMETRY&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to create a list of FCs that meet certain SQL criteria:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Loop through all FC in a specific data owner called &amp;lt;MY_USER&amp;gt;.&lt;/LI&gt;&lt;LI&gt;For each FC, run a SQL query:&lt;BR /&gt;&lt;PRE&gt;select
    *
from
    &lt;FONT color="#999999"&gt;--FC name&lt;/FONT&gt;
where
    (sde.st_isempty(shape) = 1 and sde.st_area(shape) is null)&lt;BR /&gt;    and shape is null &lt;FONT color="#999999"&gt;--It's counterintuitive, but this will actually select some features where shape is &lt;STRONG&gt;not&lt;/STRONG&gt; null. The shape data appears to be broken. Explanation below.&lt;/FONT&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;If the query returns at least one row (or, alternatively, if&amp;nbsp;&lt;FONT face="courier new,courier" color="#999999"&gt;count(*) &amp;gt;= 1&lt;/FONT&gt;), then print the FC name to a list.&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;Use case:&lt;/P&gt;&lt;P&gt;I'm troubleshooting an issue with Esri Support in Case #03477586 where some of my features appear to be broken. If I query WHERE SHAPE IS NULL, then the query selects certain features even if though the shape isn't null. Support says BUG-000090937 describes a known issue &lt;EM&gt;"...Reproducible at ArcGIS Desktop 10.3.1 where inserting a new record into an attribute table in ArcMap without creating a corresponding shape would result in a NULL Geometry BLOB."&lt;/EM&gt; As mentioned, those old features seem to be broken when querying WHERE SHAPE IS NULL. Features created in modern versions of ArcMap and ArcGIS Pro don't seem to have this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1699456843176.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85370iF02E7ED1C6C390C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1699456843176.png" alt="Bud_0-1699456843176.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Action:&lt;/P&gt;&lt;P&gt;I want to create a list of FCs that have broken shapes. I will manually perform a field calculation on the broken shapes; I'll update shape=shape which will fix those shapes. Explanation: Most operations in ArcGIS Pro automatically change/fix features so that they go from "has shape, but geometry is null" to "has shape, but geometry is nill/zero-vertex". More info here:&amp;nbsp;&lt;A href="https://community.esri.com/t5/data-management-questions/select-features-with-blank-shapes/td-p/1346965" target="_self"&gt;Select features with blank shapes&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;How can I create&amp;nbsp;a list of FCs that meet that SQL criteria using Python?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 15:20:56 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2023-11-08T15:20:56Z</dc:date>
    <item>
      <title>List of FCs that meet certain SQL criteria</title>
      <link>https://community.esri.com/t5/python-questions/list-of-fcs-that-meet-certain-sql-criteria/m-p/1347170#M69190</link>
      <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 2.6.8; Oracle 18c; 10.7.1 EGDB; SDE.ST_GEOMETRY&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to create a list of FCs that meet certain SQL criteria:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Loop through all FC in a specific data owner called &amp;lt;MY_USER&amp;gt;.&lt;/LI&gt;&lt;LI&gt;For each FC, run a SQL query:&lt;BR /&gt;&lt;PRE&gt;select
    *
from
    &lt;FONT color="#999999"&gt;--FC name&lt;/FONT&gt;
where
    (sde.st_isempty(shape) = 1 and sde.st_area(shape) is null)&lt;BR /&gt;    and shape is null &lt;FONT color="#999999"&gt;--It's counterintuitive, but this will actually select some features where shape is &lt;STRONG&gt;not&lt;/STRONG&gt; null. The shape data appears to be broken. Explanation below.&lt;/FONT&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;If the query returns at least one row (or, alternatively, if&amp;nbsp;&lt;FONT face="courier new,courier" color="#999999"&gt;count(*) &amp;gt;= 1&lt;/FONT&gt;), then print the FC name to a list.&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;Use case:&lt;/P&gt;&lt;P&gt;I'm troubleshooting an issue with Esri Support in Case #03477586 where some of my features appear to be broken. If I query WHERE SHAPE IS NULL, then the query selects certain features even if though the shape isn't null. Support says BUG-000090937 describes a known issue &lt;EM&gt;"...Reproducible at ArcGIS Desktop 10.3.1 where inserting a new record into an attribute table in ArcMap without creating a corresponding shape would result in a NULL Geometry BLOB."&lt;/EM&gt; As mentioned, those old features seem to be broken when querying WHERE SHAPE IS NULL. Features created in modern versions of ArcMap and ArcGIS Pro don't seem to have this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1699456843176.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85370iF02E7ED1C6C390C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1699456843176.png" alt="Bud_0-1699456843176.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Action:&lt;/P&gt;&lt;P&gt;I want to create a list of FCs that have broken shapes. I will manually perform a field calculation on the broken shapes; I'll update shape=shape which will fix those shapes. Explanation: Most operations in ArcGIS Pro automatically change/fix features so that they go from "has shape, but geometry is null" to "has shape, but geometry is nill/zero-vertex". More info here:&amp;nbsp;&lt;A href="https://community.esri.com/t5/data-management-questions/select-features-with-blank-shapes/td-p/1346965" target="_self"&gt;Select features with blank shapes&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;How can I create&amp;nbsp;a list of FCs that meet that SQL criteria using Python?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 15:20:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/list-of-fcs-that-meet-certain-sql-criteria/m-p/1347170#M69190</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-11-08T15:20:56Z</dc:date>
    </item>
  </channel>
</rss>

