<?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 Find multi-part features using SQL (ST_GEOMETRY) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1186466#M56562</link>
    <description>&lt;P&gt;How can I query for multi-part features in an SDE.ST_GEOMETRY FC using SQL? (in the Select By Attributes window or in a definition query)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jun 2022 03:56:15 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-06-26T03:56:15Z</dc:date>
    <item>
      <title>Find multi-part features using SQL (ST_GEOMETRY)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1186466#M56562</link>
      <description>&lt;P&gt;How can I query for multi-part features in an SDE.ST_GEOMETRY FC using SQL? (in the Select By Attributes window or in a definition query)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2022 03:56:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1186466#M56562</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-06-26T03:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Find multi-part features using SQL (ST_GEOEMTRY)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1186467#M56563</link>
      <description>&lt;P&gt;Use this WHERE clause in a definition query or the Select By Attributes window:&lt;/P&gt;&lt;PRE&gt; sde.st_numgeometries(shape) &amp;gt; 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a known bug in &lt;U&gt;versioned&lt;/U&gt; Oracle SDE.ST_GEOMETRY FCs. The above WHERE clause will throw an error:&amp;nbsp;&lt;EM&gt;&lt;U&gt;ORA-00904 Invalid Identifier "SHAPE"&lt;/U&gt;&lt;/EM&gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Defect #: BUG-000150273&lt;BR /&gt;&lt;EM&gt;"ST_GEOMETRY functions used in Select By Attributes tool on Shape field generate error "ORA-00904 Invalid Identifier "SHAPE""&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Esri Canada case #:&amp;nbsp;03080875&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Workaround:&lt;/P&gt;&lt;P&gt;Use a subquery.&lt;/P&gt;&lt;PRE&gt;objectid in &lt;BR /&gt;    (select&lt;BR /&gt;        objectid&lt;BR /&gt;    from&lt;BR /&gt;        my_owner.my_fc&lt;BR /&gt;    where&lt;BR /&gt;        sde.st_numgeometries(shape) &amp;gt; 1)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That bug only happens for SDE.ST_GEOMETRY.&lt;/P&gt;&lt;P&gt;Whereas if the FC was SDO_GEOMETRY, then spatial functions would work fine — even if the FC was versioned.&lt;/P&gt;&lt;PRE&gt;sdo_util.getnumelem(shape) &amp;gt; 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2022 03:55:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1186467#M56563</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-06-26T03:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Find multi-part features using SQL (ST_GEOMETRY)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1263521#M66137</link>
      <description>&lt;P&gt;BUG-000150273&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Status&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;In Review&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Synopsis&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;ST_Geometry functions applied to the Shape field in Select By Attributes return the error message, "Error 000358: Invalid expression" if the feature class is registered as traditional versioned.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Environment&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Reproduced in: ArcGIS Pro 3.0 or ArcGIS Pro 2.9.3 or ArcMap 10.8.2 or ArcMap 10.7.1&lt;BR /&gt;Geodatabase version 10.9.2 or 10.7.1&lt;BR /&gt;Oracle 18c&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Steps to Reproduce&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a line feature class&lt;/LI&gt;&lt;LI&gt;Add some features to feature class&lt;/LI&gt;&lt;LI&gt;Use Select by Attributes to query fc Where:&amp;nbsp;"sde.st_length(shape) &amp;gt; 400" (use whatever value makes sense for the length of the lines)&lt;/LI&gt;&lt;LI&gt;The selection will work&lt;/LI&gt;&lt;LI&gt;Register the feature class as versioned&lt;/LI&gt;&lt;LI&gt;Repeat the Select by Attribute query from step 3 - you will receive an error&amp;nbsp;"Error 000358: Invalid expression"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Additional information&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Not reproducible in SQL Server (i.e. "SHAPE.STLength() &amp;gt; 400"&lt;/LI&gt;&lt;LI&gt;Similar to&amp;nbsp;&lt;STRONG&gt;BUG-000109287&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Reproducible with other queries (i.e. query customer was using "abs(sde.st_maxm(shape) - sde.st_length(shape))&amp;nbsp;&amp;nbsp;&amp;gt; 1" - find polylines where the maximum M-value doesn't equal the length)&lt;/LI&gt;&lt;LI&gt;Error in ArcMap is: [ORA-00904: "SHAPE": invalid identifier]&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Workarounds&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Place the expression in subquery. For example:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;OBJECTID IN&amp;nbsp;&lt;/P&gt;&lt;P&gt;(SELECT&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;OBJECTID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;USER1.ACTIVE_TRANSPORTATION&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;sde.st_length(shape) &amp;gt; 400&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;[OR]&lt;BR /&gt;Use calculate geometry or calculate field to populate new fields with the values. Then, apply any further ST_Geometry functions on the fields instead of using the shape field.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 02 Mar 2023 14:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1263521#M66137</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-03-02T14:53:29Z</dc:date>
    </item>
  </channel>
</rss>

