<?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: Make Query Layer (Data Management) Returns Empty Layer in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476268#M83540</link>
    <description>&lt;P&gt;Is the relationship between&amp;nbsp;dbo.parcel_polygon and&amp;nbsp;dbo.ParcelWeb one-to-many?&lt;/P&gt;&lt;P&gt;If yes, then that suggests to me that you wouldn't have a unique ID column to work with in the query, due to the&amp;nbsp;LEFT OUTER JOIN. Unless you're using multiple fields as the unique ID in the query layer, which I haven't done; I always use a single field as the unique ID, out of habit.&lt;/P&gt;&lt;P&gt;I often generate a unique ID column in the query using Oracle's rownum pseduocolumn:&lt;/P&gt;&lt;PRE&gt;select&lt;BR /&gt;    cast(rownum as int) as unique_id,&lt;BR /&gt;    a.*&lt;BR /&gt;from&lt;BR /&gt;    (select ...) a&lt;/PRE&gt;&lt;P&gt;Does SQL Server have an equivalent mechanism to generate unique IDs in a query?&lt;/P&gt;&lt;P&gt;Just a heads up that you likely shouldn't check for duplicate IDs in ArcGIS Pro/in the query layer, since query layers automatically exclude duplicate rows from the resultset. I think you should check for duplicate IDs (in the&amp;nbsp;&lt;STRONG&gt;query&lt;/STRONG&gt;, not in the underlying tables) using a query in a SQL client.&lt;/P&gt;&lt;P&gt;There are portable SQL clients (no Windows admin privileges needed).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Does a query layer work if you simplify it? For example, SELECT * FROM DBO.PARCEL_POLYGON .&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2024 14:57:27 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2024-05-21T14:57:27Z</dc:date>
    <item>
      <title>Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1475820#M83511</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to use the tool Make Query Layer (Data Management) but every time it returns an empty layer. I am able to successfully create the query layer by going to Map - Add Data - Query Layer. In both situations, I am using the same SDE database connection, same feature class and table, and same exact query expression.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select a.OBJECTID, a.PIN, a.Subtype, b.parcel_no, b.siteaddress, b.site_citystzip, b.sw_hauler, b.sw_service_day, b.sw_str_sweep_week, a.GlobalID, a.Shape, b.own1 from dbo.parcel_polygon a left outer join dbo.ParcelWeb b on a.pin = b.pin where a.status&amp;nbsp; != 'Retired' and a.status != 'Pending_Retired' and a.status != 'Pending'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Has anyone else had a similar situation or can provide any insight? Also, the reason I am wanting to use Make Query Layer is because I want to include that tool in a Model (eventually python) to run nightly updates and have the data be pushed from the resulted query layer to an SDE feature class.&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 19:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1475820#M83511</guid>
      <dc:creator>AJFerrand1</dc:creator>
      <dc:date>2024-05-20T19:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1475837#M83512</link>
      <description>&lt;P&gt;Your SQL code would be far more legible if you formatted it in a SQL code block:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;SELECT  a.OBJECTID,
        a.PIN,
        a.Subtype,
        b.parcel_no,
        b.siteaddress,
        b.site_citystzip,
        b.sw_hauler,
        b.sw_service_day,
        b.sw_str_sweep_week,
        a.GlobalID,
        a.Shape,
        b.own1
FROM    dbo.parcel_polygon a 
LEFT OUTER JOIN dbo.ParcelWeb b ON a.pin = b.pin 
WHERE   a.status != 'Retired' 
    and a.status != 'Pending_Retired'
    and a.status != 'Pending'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From this vantage point, we can see:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You've used "!=" not the ISO standard SQL "not equal" operator "&amp;lt;&amp;gt;"&lt;/LI&gt;&lt;LI&gt;Your WHERE clause is an AND of several NOT EQUAL tests (which can't be effectively searched by as index)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So the first question is what are the valid values in &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;a.status&lt;/FONT&gt;&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;SELECT DISTINCT a.status FROM dbo.parcel_polygon a&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And what are the table counts across the joins?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;SELECT 
    (SELECT count(*) FROM dbo.parcel_polygon       ) as acount,
    (SELECT count(*) FROM dbo.ParcelWeb            ) as bcount,
    (SELECT count(*) FROM dbo.parcel_polygon
     LEFT OUTER JOIN dbo.ParcelWeb b ON b.pin = a.pin) as jcount,
    (SELECT count(*) FROM dbo.parcel_polygon a
     WHERE field not in ('Retired','Pending_Retired','Pending')) as qcount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Debugging joins is a stepwise process, stripping out not required components to determine where your logic doesn't align with that of the database.&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 20:29:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1475837#M83512</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2024-05-20T20:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1475858#M83513</link>
      <description>&lt;P&gt;Vince,&lt;/P&gt;&lt;P&gt;Thank you. I do understand how it should be formatted in SQL however as mentioned I am working in the tool Make Query Layer and am forced to use window (as shown on the attachment) and do not have the freedom of doing formatting like you showed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As mentioned in my post above, my issue is the Query Layer is not populating data when using the tool Make Query Layer. But if I use the same exact expression (regardless of formatting) in the window New Query Layer (which is accessed by from Map - Add Data - Query Layer), the Query Layer gets created without any problems.&lt;/P&gt;&lt;P&gt;Also when I run Make Query Layer, it returns an empty layer. However if I right click on the newly created query layer and go to Properties then Source then click on the pencil icon to edit the query, I am prompted with the same window used in New Query Layer (as mentioned above). If I complete the prompts from that window (Validate, Next, Finish) the layer is now populated with data. Even though I made zero changes to the expression.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 20:41:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1475858#M83513</guid>
      <dc:creator>AJFerrand1</dc:creator>
      <dc:date>2024-05-20T20:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476148#M83532</link>
      <description>&lt;P&gt;Are the tables &lt;STRONG&gt;registered&lt;/STRONG&gt; with an enterprise geodatabase?&lt;/P&gt;&lt;P&gt;I ask because I had a somewhat similar problem in an Esri Supoport case with FCs that weren't registered with a geodatabase (ArcGIS Pro 3.3.0; Oracle 18c database; non-geodatabase):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Esri Case #03625510 - M-enabled SDO_GEOMETRY FC not displaying in map [unregistered feature class]&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;BUG-000163909: 3D data in an unregistered feature class with SDO_Geometry is not displayed on the map in ArcGIS Pro.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;The layer didn’t display in the map, although there were rows in the attribute table. But if I made &lt;STRONG&gt;any&lt;/STRONG&gt; change to the default query layer SQL, then that fixed the query layer; it would display in the map.&amp;nbsp;Even putting a random comment like /* hot dog! */ in the SQL makes the layer work.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;What version of SQL Server?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;What version of ArcGIS Enterprise?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;What version of Pro?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Is your unique ID column truly unique and without nulls?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 21 May 2024 21:08:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476148#M83532</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-05-21T21:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476251#M83538</link>
      <description>&lt;P&gt;Hello Bud,&lt;/P&gt;&lt;P&gt;Yes the parcel_polygon feature class is registered as versioned (which we tried adding that table as parcel_polygon_evw, since it adds _evw when the table is registered as versioned but still no luck).&lt;/P&gt;&lt;P&gt;Exactly! I would just edit the query by adding a space or nothing at all and it would work. But the tool itself isn't creating the layer.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What version of SQL Server? We are using 2022.&lt;/LI&gt;&lt;LI&gt;What version of ArcGIS Enterprise? We are at 10.9.1&lt;/LI&gt;&lt;LI&gt;What version of Pro? We are using 3.1.5, which I know Esri frowns upon. So I have another machine on 2.9.5, but haven't test it there yet.&lt;/LI&gt;&lt;LI&gt;Is your unique ID column truly unique and without nulls? Yes.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 21 May 2024 14:06:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476251#M83538</guid>
      <dc:creator>AJFerrand1</dc:creator>
      <dc:date>2024-05-21T14:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476258#M83539</link>
      <description>&lt;P&gt;Just to clarify, &lt;EM&gt;registered with the geodatabase&lt;/EM&gt; is different from r&lt;EM&gt;egistered as versioned&lt;/EM&gt;. But I assume it's not possible to &lt;EM&gt;register as versioned&lt;/EM&gt; without first being &lt;EM&gt;registered with the geodatabase&lt;/EM&gt;. So I think you answered the &lt;EM&gt;registered as versioned&lt;/EM&gt; question indirectly.&lt;/P&gt;&lt;P&gt;Other questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;What spatial type is the SHAPE column?&lt;/LI&gt;&lt;LI&gt;Is the FC Z-enabled?&lt;/LI&gt;&lt;LI&gt;Is the FC M-enabled?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 21 May 2024 14:19:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476258#M83539</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-05-21T14:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476268#M83540</link>
      <description>&lt;P&gt;Is the relationship between&amp;nbsp;dbo.parcel_polygon and&amp;nbsp;dbo.ParcelWeb one-to-many?&lt;/P&gt;&lt;P&gt;If yes, then that suggests to me that you wouldn't have a unique ID column to work with in the query, due to the&amp;nbsp;LEFT OUTER JOIN. Unless you're using multiple fields as the unique ID in the query layer, which I haven't done; I always use a single field as the unique ID, out of habit.&lt;/P&gt;&lt;P&gt;I often generate a unique ID column in the query using Oracle's rownum pseduocolumn:&lt;/P&gt;&lt;PRE&gt;select&lt;BR /&gt;    cast(rownum as int) as unique_id,&lt;BR /&gt;    a.*&lt;BR /&gt;from&lt;BR /&gt;    (select ...) a&lt;/PRE&gt;&lt;P&gt;Does SQL Server have an equivalent mechanism to generate unique IDs in a query?&lt;/P&gt;&lt;P&gt;Just a heads up that you likely shouldn't check for duplicate IDs in ArcGIS Pro/in the query layer, since query layers automatically exclude duplicate rows from the resultset. I think you should check for duplicate IDs (in the&amp;nbsp;&lt;STRONG&gt;query&lt;/STRONG&gt;, not in the underlying tables) using a query in a SQL client.&lt;/P&gt;&lt;P&gt;There are portable SQL clients (no Windows admin privileges needed).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Does a query layer work if you simplify it? For example, SELECT * FROM DBO.PARCEL_POLYGON .&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 14:57:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476268#M83540</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-05-21T14:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476278#M83542</link>
      <description>&lt;P&gt;If the data is versioned, you would have to use the versioned view to query data in the DEFAULT version.&lt;BR /&gt;&lt;BR /&gt;I am not sure that you can change the version in the query layer window. This could be done in SQL Server as a view.&lt;BR /&gt;&lt;BR /&gt;You can reconcile / post all the edits to default, then compress and it should move the edits to the base table.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 14:38:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476278#M83542</guid>
      <dc:creator>George_Thompson</dc:creator>
      <dc:date>2024-05-21T14:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Make Query Layer (Data Management) Returns Empty Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476347#M83553</link>
      <description>&lt;P&gt;This whole time I have been trying to run Make Query Layer in ArcGIS Pro 3.1.&lt;/P&gt;&lt;P&gt;I just ran the same tool and same expression in ArcGIS Pro 2.9, and the tool worked perfectly fine.&lt;/P&gt;&lt;P&gt;It appears there is a compatibility issue between the version of Pro I was using and the version of Enterprise.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 16:07:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/make-query-layer-data-management-returns-empty/m-p/1476347#M83553</guid>
      <dc:creator>AJFerrand1</dc:creator>
      <dc:date>2024-05-21T16:07:00Z</dc:date>
    </item>
  </channel>
</rss>

