<?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 Why would MakeQueryLayer_management return an empty object? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1097058#M45409</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using MakeQueryLayer_management to read from a Postgres database and populate a table in a file geodatabase.&lt;/P&gt;&lt;P&gt;I have two sde connections for the postgres database. Let's call them user_A.sde and user_B.sde. Each corresponds to a user on the postgres database with the same permissions. Both users can query the table in a third party tool. And both connections can view the table in ArcGIS Pro. And both connections can drag and drop the table into an ArcGIS Pro project.&lt;/P&gt;&lt;P&gt;The problem is when I call MakeQueryLayer_management in ArcPy, one of the users returns the table as expected and the other returns an empty result object. The only change I am making is the path to the sde connection file.&lt;/P&gt;&lt;P&gt;Why would MakeQueryLayer_management return an empty object?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 10 Sep 2021 00:40:59 GMT</pubDate>
    <dc:creator>JesseTemplin2</dc:creator>
    <dc:date>2021-09-10T00:40:59Z</dc:date>
    <item>
      <title>Why would MakeQueryLayer_management return an empty object?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1097058#M45409</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using MakeQueryLayer_management to read from a Postgres database and populate a table in a file geodatabase.&lt;/P&gt;&lt;P&gt;I have two sde connections for the postgres database. Let's call them user_A.sde and user_B.sde. Each corresponds to a user on the postgres database with the same permissions. Both users can query the table in a third party tool. And both connections can view the table in ArcGIS Pro. And both connections can drag and drop the table into an ArcGIS Pro project.&lt;/P&gt;&lt;P&gt;The problem is when I call MakeQueryLayer_management in ArcPy, one of the users returns the table as expected and the other returns an empty result object. The only change I am making is the path to the sde connection file.&lt;/P&gt;&lt;P&gt;Why would MakeQueryLayer_management return an empty object?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 00:40:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1097058#M45409</guid>
      <dc:creator>JesseTemplin2</dc:creator>
      <dc:date>2021-09-10T00:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why would MakeQueryLayer_management return an empty object?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1097060#M45410</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/431300"&gt;@JesseTemplin2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;According to the usage notes in the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-query-layer.htm" target="_self"&gt;tool documentation&lt;/A&gt;:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;If the result of the SQL query does not return any rows, the output query layer will be empty, only containing the schema of the columns returned by the query.&amp;nbsp;&lt;/SPAN&gt;In this case, if the columns returned contain a spatial column, the tool will use the following defaults to create the query layer:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Geometry type—POINT&lt;/LI&gt;&lt;LI&gt;SRID—1&lt;/LI&gt;&lt;LI&gt;Spatial Reference—NAD1983&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Then you need to determine whether any of these values should be changed before executing the tool.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So perhaps the Query is not correct? Can you run the tool in ArcGIS Pro and copy the snippet to your python script and see if it works?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 01:06:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1097060#M45410</guid>
      <dc:creator>LongDinh</dc:creator>
      <dc:date>2021-09-10T01:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why would MakeQueryLayer_management return an empty object?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1097244#M45437</link>
      <description>&lt;P&gt;Same deal if I run the tool in ArcGIS Pro. The query is a simple select * from table. One sde connection creates a table and the other doesn't.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 15:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1097244#M45437</guid>
      <dc:creator>JesseTemplin2</dc:creator>
      <dc:date>2021-09-10T15:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why would MakeQueryLayer_management return an empty object?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1101310#M45942</link>
      <description>&lt;P&gt;This appears to be a bug, not limited to MakeQueryLayer&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEzOTkyNw==" target="_self"&gt;BUG-000139927&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 16:08:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1101310#M45942</guid>
      <dc:creator>JesseTemplin2</dc:creator>
      <dc:date>2021-09-23T16:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why would MakeQueryLayer_management return an empty object?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1412547#M82130</link>
      <description>&lt;P&gt;Hello and welcome from the future. I am able to replicate this bug though in a different way. I get ERROR 99999 if I attempt to create a query layer using MakeQueryLayer when connected with a username that has a period. Thanks for posting it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;ArcGIS Pro: 3.1.2&lt;BR /&gt;DB: SQL Server 15&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 21:55:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-would-makequerylayer-management-return-an/m-p/1412547#M82130</guid>
      <dc:creator>PhilLarkin1</dc:creator>
      <dc:date>2024-04-19T21:55:27Z</dc:date>
    </item>
  </channel>
</rss>

