<?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: Create Query Layer Tool Output Object Not Found or Recognized in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216063#M7410</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having exactly the same problem here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like the result of the Query layer Tool cannot be used by other subsequent tools in model builder or python, unless you make it manually.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying to use the Generate XY Events tool with the result of the Make Query Layer tool, but all i could get was error 00023 (Canot access to the event table properties)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried any possible tools to convert the Query layer into another type of structure (table, view, etc.) and also tried to save it in whatever type of file, with absolutely no succes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same things happens in Model Builder and Python. But manually in ArcMap, it works great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please, do someone has a workaround for this ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bakary.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Mar 2014 15:49:18 GMT</pubDate>
    <dc:creator>BakaryKoné</dc:creator>
    <dc:date>2014-03-12T15:49:18Z</dc:date>
    <item>
      <title>Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216062#M7409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcGIS 10.1 SP1. ArcSDE 10.1, SQL Server 2008 R2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been trying to use the Make Query Layer Tool to create a table view from SDE tables (_VM) in SQL Server 2008 R2 and save the table by a number of export methods with limited success. I have been unsuccessful in saving the information through either the tools, modelbuilder, python window or arcpy (external python). Only manual export is working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tool "make query layer" ran from within ArcMap will create the proper table from the SDE/SQL Server 2008R2 query and tables, however, it is not possible to export this Table_View layer using export Table to Table&amp;nbsp; or CopyRows or Table to Geodatabase as shown in the help literature. The ONLY method to export the information has been in the Table of Contents (TOC), through export from the table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Delving a little deeper I tried to get a little infomration on this object and it appears to contain part of the SQL/SDE connection string as part of it's object as several tools have indicated a .name of "SEKI_HazardTrees.DBO.%HazTree" when the original given name is HazTree only (SEKI_HazardTrees is the name of the SQL/SDE database). I also receive this name when I run arcpy.describe on the object and return a path of the sde connection string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;desc.name = SEKI_HazardTrees.DBO.%HazTree&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc.dataType = TableView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc.nameString = HazTree&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc.path = Z:\Projects\HazardTrees\inpsekigistest_HazardTrees.sde ( the path of the SQL database) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error received is very general and similar between failing tools:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Failed to convert SEKI_HazardTrees.DBO.%HazTree. ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Failed to execute (CopyRows).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Cannot open HazTree (the Table View - in arcpy)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to override the tool from including the SEKI_HazardTrees to it's name by setting up the scratch and normal workspaces to no avail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IF you have a working python .py example of this (not from the ESRI site that does not work) please post. I have tried all the versions posted by ESRI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm including my code here for what its worth, but since the stand-alone tools couldn't work I wouldn't expect the arcpy gp tools to work any better (although sometimes they do).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;python code&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#Import system modules
import arcpy

arcpy.env.overwriteOutput = True

# Set data path also tried removing the r and change / to //
workspace = r"Z:/Projects/HazardTrees/Results.gdb"
intable = r"Z:/Projects/HazardTrees/Results.gdb/Veg_HazardTreeSurvey_tbl"

inpsekigistest_HazardTrees_sde = r"Z:/Projects/HazardTrees/inpsekigistest_HazardTrees.sde"

arcpy.env.workspace = workspace
arcpy.env.scratch = workspace

# Create the Query Layer and return the Table-View name for verification
test = arcpy.MakeQueryLayer_management(inpsekigistest_HazardTrees_sde, "HazTree", "SELECT * from SEKI_HazardTrees.dbo.Veg_HazardTreeSurvey_tbl_VW", "OBJECTID", "", "", "").getOutput(0)
# Get the properties of the Query Layer if possible
objMQ = arcpy.Describe(test)
print objMQ.name
print objMQ.dataType
print objMQ.nameString
print objMQ.path
print test

# Get column count - note that if the MakequeryLayer function fails, then an empty table with only the schema will be produced.
# However, we have tested this and copied the SQL query and parameters from ArcMap tools for which we were successful generating the Table View so this should be ok

#print int(arcpy.GetCount_management(test).getOutput(0))&amp;nbsp;&amp;nbsp; # doesn't work
#print int(arcpy.GetCount_management("HazTree").getOutput(0)) # doesn't work

#arcpy.CopyRows_management(test, r"Z:/Projects/HazardTrees/hz002.dbf")&amp;nbsp; # doesn't work Error 99999
#arcpy.CopyRows_management(test, "Z://Projects//HazardTrees//hz002.dbf")&amp;nbsp; # doesn't work Error 99999&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 18:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216062#M7409</guid>
      <dc:creator>KevinMorris</dc:creator>
      <dc:date>2013-09-05T18:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216063#M7410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having exactly the same problem here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like the result of the Query layer Tool cannot be used by other subsequent tools in model builder or python, unless you make it manually.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying to use the Generate XY Events tool with the result of the Make Query Layer tool, but all i could get was error 00023 (Canot access to the event table properties)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried any possible tools to convert the Query layer into another type of structure (table, view, etc.) and also tried to save it in whatever type of file, with absolutely no succes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same things happens in Model Builder and Python. But manually in ArcMap, it works great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please, do someone has a workaround for this ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bakary.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 15:49:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216063#M7410</guid>
      <dc:creator>BakaryKoné</dc:creator>
      <dc:date>2014-03-12T15:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216064#M7411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Facing similar issue..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 20:22:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216064#M7411</guid>
      <dc:creator>muhammadalmas</dc:creator>
      <dc:date>2014-03-12T20:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216065#M7412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am also facing a similar problem.&amp;nbsp; Trying to use arcpy.makequerylayer on&amp;nbsp; table with lat/long fields but&amp;nbsp; no shape field.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 15:15:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216065#M7412</guid>
      <dc:creator>MattGray</dc:creator>
      <dc:date>2014-03-14T15:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216066#M7413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;python code&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#Import system modules
import arcpy

arcpy.env.overwriteOutput = True

# Set data path also tried removing the r and change / to //
workspace = r"Z:/Projects/HazardTrees/Results.gdb"
intable = r"Z:/Projects/HazardTrees/Results.gdb/Veg_HazardTreeSurvey_tbl"

inpsekigistest_HazardTrees_sde = r"Z:/Projects/HazardTrees/inpsekigistest_HazardTrees.sde"

arcpy.env.workspace = workspace
arcpy.env.scratch = workspace

# Create the Query Layer and return the Table-View name for verification
test = arcpy.MakeQueryLayer_management(inpsekigistest_HazardTrees_sde, "HazTree", "SELECT * from SEKI_HazardTrees.dbo.Veg_HazardTreeSurvey_tbl_VW", "OBJECTID", "", "", "").getOutput(0)
# Get the properties of the Query Layer if possible
objMQ = arcpy.Describe(test)
print objMQ.name
print objMQ.dataType
print objMQ.nameString
print objMQ.path
print test

t = arcpy.mapping.TableView(test[0])
arcpy.TableToTable_conversion(t, workspace, "hz002")


# Get column count - note that if the MakequeryLayer function fails, then an empty table with only the schema will be produced.
# However, we have tested this and copied the SQL query and parameters from ArcMap tools for which we were successful generating the Table View so this should be ok

#print int(arcpy.GetCount_management(test).getOutput(0))&amp;nbsp;&amp;nbsp; # doesn't work
#print int(arcpy.GetCount_management("HazTree").getOutput(0)) # doesn't work

#arcpy.CopyRows_management(test, r"Z:/Projects/HazardTrees/hz002.dbf")&amp;nbsp; # doesn't work Error 99999
#arcpy.CopyRows_management(test, "Z://Projects//HazardTrees//hz002.dbf")&amp;nbsp; # doesn't work Error 99999&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Add the following to your script after you create your query layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t = arcpy.mapping.TableView(test[0])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.TableToTable_conversion(t, workspace, "hz002")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want it to save as a dbf, you can replace the TableToTable with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.TableToDBASE_conversion(t, r"Z:/Projects/HazardTrees")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s300000017000000" rel="nofollow noopener noreferrer" target="_blank"&gt;TableView &lt;/A&gt;&lt;SPAN&gt;for more details.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:34:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216066#M7413</guid>
      <dc:creator>LeonardRugiel</dc:creator>
      <dc:date>2021-12-11T10:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216067#M7414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Had the same issue.&amp;nbsp; This works, thank you &lt;A href="https://community.esri.com/migrated-users/33895"&gt;Leonard Rugiel&lt;/A&gt;​ so much!&amp;nbsp; I couldn't do anything with the table view coming from the Make Query Layer tool until now. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 19:40:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216067#M7414</guid>
      <dc:creator>StuartPersyn</dc:creator>
      <dc:date>2015-11-06T19:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216068#M7415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will this code also work if you need to create a featurelayer from the query layer instead of a tableview?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 16:49:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216068#M7415</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2016-04-15T16:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create Query Layer Tool Output Object Not Found or Recognized</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216069#M7416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure whether this addresses your problem but I found it (and then this thread) during my search for solving another issue.&amp;nbsp; Based on it, you may want to check that background geoprocessing is turned off. &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/60908"&gt;Can't get reference to result from MakeQueryLayer_management&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 May 2016 15:07:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-query-layer-tool-output-object-not-found-or/m-p/216069#M7416</guid>
      <dc:creator>DanNarsavage</dc:creator>
      <dc:date>2016-05-04T15:07:05Z</dc:date>
    </item>
  </channel>
</rss>

