<?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: Definition query on a query layer? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/definition-query-on-a-query-layer/m-p/1277860#M67887</link>
    <description>&lt;P&gt;This is a definite edge case, but we have a database that pulls &lt;EM&gt;everything&lt;/EM&gt; from OpenStreetMap for our county and keeps them in generalized tables (with an &lt;STRONG&gt;hstore&lt;/STRONG&gt; column "tags" holding all the attributes).&lt;/P&gt;&lt;P&gt;If I'm doing something with transportation, I'll have a WHERE clause like&lt;/P&gt;&lt;PRE&gt;tags -&amp;gt; 'highway' is not null&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;to get the routable linear features. But I may want to toggle whole categories of features on and off within that layer, so a definition query to focus on pedestrian or cycling features can be handy, so having a handful of definition queries makes it easy to flip between different sets.&lt;/P&gt;&lt;P&gt;To me, the WHERE clause is for a filter I don't ever mean to adjust, it's part of the layer's "definition". The definition query, though, is more like a "filter widget" to me, and is something I intend to turn on and off as needed.&lt;/P&gt;&lt;P&gt;Of course, using discrete parameters in the query can accomplish that, too, for simpler use cases.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2023 16:02:54 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2023-04-12T16:02:54Z</dc:date>
    <item>
      <title>Definition query on a query layer?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/definition-query-on-a-query-layer/m-p/1277815#M67879</link>
      <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 2.6.8; Oracle 18c 10.7.1 EGDB&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I noticed recently that it's possible to create a definition query on a query layer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1681309813559.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67768iB4E5A286F79A6803/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1681309813559.png" alt="Bud_0-1681309813559.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I suppose that makes sense. All feature layers in the Contents pane have a definition query section in the layer properties, including query layers.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Out of curiosity, does anyone ever do that -- have a query layer that has a WHERE clause in the SQL definition, &lt;STRONG&gt;and&lt;/STRONG&gt; have a definition query too? If so, what's the use case?&lt;/P&gt;&lt;P&gt;It might seem a bit strange to have WHERE clauses in both places. But I suppose definition queries are more convenient to modify than query layer SQL definitions, so maybe that's a reason to do it?&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 14:36:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/definition-query-on-a-query-layer/m-p/1277815#M67879</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-04-12T14:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query on a query layer?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/definition-query-on-a-query-layer/m-p/1277860#M67887</link>
      <description>&lt;P&gt;This is a definite edge case, but we have a database that pulls &lt;EM&gt;everything&lt;/EM&gt; from OpenStreetMap for our county and keeps them in generalized tables (with an &lt;STRONG&gt;hstore&lt;/STRONG&gt; column "tags" holding all the attributes).&lt;/P&gt;&lt;P&gt;If I'm doing something with transportation, I'll have a WHERE clause like&lt;/P&gt;&lt;PRE&gt;tags -&amp;gt; 'highway' is not null&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;to get the routable linear features. But I may want to toggle whole categories of features on and off within that layer, so a definition query to focus on pedestrian or cycling features can be handy, so having a handful of definition queries makes it easy to flip between different sets.&lt;/P&gt;&lt;P&gt;To me, the WHERE clause is for a filter I don't ever mean to adjust, it's part of the layer's "definition". The definition query, though, is more like a "filter widget" to me, and is something I intend to turn on and off as needed.&lt;/P&gt;&lt;P&gt;Of course, using discrete parameters in the query can accomplish that, too, for simpler use cases.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 16:02:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/definition-query-on-a-query-layer/m-p/1277860#M67887</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-04-12T16:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query on a query layer?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/definition-query-on-a-query-layer/m-p/1501887#M85283</link>
      <description>&lt;P&gt;Esri Case #03621411 - Invalid Syntax error when subquery used on unregistered table, query layer, or database view&lt;/P&gt;&lt;P&gt;BUG-000168914: Error "The SQL expression has invalid syntax" is encountered when a subquery is used on an unregistered table, query layer, or unregistered database view.&lt;/P&gt;&lt;P&gt;That issue applies to definition queries and Select By Attributes.&lt;/P&gt;&lt;P&gt;ArcGIS Pro 3.3.0;&amp;nbsp;Oracle 18c 10.7.1 EGDB&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;table_non_reg_gdb.objectid IN (SELECT objectid FROM table_non_reg_gdb t2 WHERE t2.event_id = table_non_reg_gdb.event_id and fund_source =&amp;nbsp; 'TOT' ORDER BY year_fund DESC FETCH FIRST ROW ONLY)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 15:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/definition-query-on-a-query-layer/m-p/1501887#M85283</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-07-05T15:59:54Z</dc:date>
    </item>
  </channel>
</rss>

