<?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 Create FGDB database view using the ORDER BY clause: ERROR 999999 in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/create-fgdb-database-view-using-the-order-by/m-p/1371894#M77617</link>
    <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 3.2.1; file geodatabase.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Background:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In a mobile geodatabase, I can create the following database view without issue:&lt;/P&gt;&lt;PRE&gt;select
    population_centre,
    population_2021
from
    cities
order by
    population_2021 desc&lt;/PRE&gt;&lt;P&gt;But if I try to create the same view in a file geodatabase, then I get ERROR 999999:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1705609695126.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92059i2FB86E6861471D5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1705609695126.png" alt="Bud_0-1705609695126.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The culprit seems to be the ORDER BY clause. If I were to remove the ORDER BY, then I could create the view.&lt;/P&gt;&lt;PRE&gt;select
    population_centre,
    population_2021
from
    cities&lt;/PRE&gt;&lt;P&gt;But that would defeat the purpose of the view: to sort population_2021 (descending).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm aware that there is a Sort geoprocessing tool. But I don't want to use it since it outputs a static FC. I want a dynamic query.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Related:&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Esri Case #03531064 - Create FGDB database view using the ORDER BY clause: ERROR 999999&lt;/P&gt;&lt;P&gt;...this is a known defect that will sadly not be addressed at this time. The 'ORDER BY' parameter must not be used as a part of a view as it is not supported on all views in many data sources. This applies to a file geodatabase and many RDBMS, for example, Oracle.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/the-create-database-view-data-management-tool-fails-whe-bug-000133228" target="_self"&gt;BUG-000133228&lt;/A&gt;&amp;nbsp;The Create Database View (Data Management) tool fails when a derived field is used in the ORDER BY clause.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/the-create-database-view-tool-fails-to-create-a-new-vie-bug-000134186" target="_self"&gt;BUG-000134186&lt;/A&gt;&amp;nbsp;The 'Create Database View' tool fails to create a new view, and returns an error message, "Error 999999: Something unexpected caused the tool to fail." when the 'ORDER BY' parameter is used for a file geodatabase in ArcGIS Pro.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Question:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Are there any workarounds for this issue?&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2024 20:53:20 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2024-01-18T20:53:20Z</dc:date>
    <item>
      <title>Create FGDB database view using the ORDER BY clause: ERROR 999999</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/create-fgdb-database-view-using-the-order-by/m-p/1371894#M77617</link>
      <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 3.2.1; file geodatabase.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Background:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In a mobile geodatabase, I can create the following database view without issue:&lt;/P&gt;&lt;PRE&gt;select
    population_centre,
    population_2021
from
    cities
order by
    population_2021 desc&lt;/PRE&gt;&lt;P&gt;But if I try to create the same view in a file geodatabase, then I get ERROR 999999:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1705609695126.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92059i2FB86E6861471D5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1705609695126.png" alt="Bud_0-1705609695126.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The culprit seems to be the ORDER BY clause. If I were to remove the ORDER BY, then I could create the view.&lt;/P&gt;&lt;PRE&gt;select
    population_centre,
    population_2021
from
    cities&lt;/PRE&gt;&lt;P&gt;But that would defeat the purpose of the view: to sort population_2021 (descending).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm aware that there is a Sort geoprocessing tool. But I don't want to use it since it outputs a static FC. I want a dynamic query.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Related:&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Esri Case #03531064 - Create FGDB database view using the ORDER BY clause: ERROR 999999&lt;/P&gt;&lt;P&gt;...this is a known defect that will sadly not be addressed at this time. The 'ORDER BY' parameter must not be used as a part of a view as it is not supported on all views in many data sources. This applies to a file geodatabase and many RDBMS, for example, Oracle.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/the-create-database-view-data-management-tool-fails-whe-bug-000133228" target="_self"&gt;BUG-000133228&lt;/A&gt;&amp;nbsp;The Create Database View (Data Management) tool fails when a derived field is used in the ORDER BY clause.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/the-create-database-view-tool-fails-to-create-a-new-vie-bug-000134186" target="_self"&gt;BUG-000134186&lt;/A&gt;&amp;nbsp;The 'Create Database View' tool fails to create a new view, and returns an error message, "Error 999999: Something unexpected caused the tool to fail." when the 'ORDER BY' parameter is used for a file geodatabase in ArcGIS Pro.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Question:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Are there any workarounds for this issue?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 20:53:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/create-fgdb-database-view-using-the-order-by/m-p/1371894#M77617</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-18T20:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create FGDB database view using the ORDER BY clause: ERROR 999999</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/create-fgdb-database-view-using-the-order-by/m-p/1371895#M77618</link>
      <description>&lt;P&gt;I can wrap it in an outer query:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;select
    *
from
    (&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;    select
        population_centre,
        population_2021
    from
        cities
    order by
        population_2021 desc
    &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Now, I can create the view without issue. The ORDER BY works as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 20:37:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/create-fgdb-database-view-using-the-order-by/m-p/1371895#M77618</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-18T20:37:00Z</dc:date>
    </item>
  </channel>
</rss>

