<?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 Append works in 2.x but not 3.x in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401017#M70176</link>
    <description>&lt;P&gt;Moving from older Desktop 2.x script to 3.x in Pro. For some reason, the script fails in 3.x when trying to Append. Two query tables are created with the exact same fields and joins from different layers.&amp;nbsp; One is created and written to a table, then the other one is created with a query table an appended to the first.Script has been working for years. Tried with and without the brackets.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.management.Append([lyrNameVN], finalTable,"NO_TEST")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is the ever helpful "ERROR 999999: Something unexpected caused the tool to fail"&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2024 17:15:04 GMT</pubDate>
    <dc:creator>MichaelKohler</dc:creator>
    <dc:date>2024-03-26T17:15:04Z</dc:date>
    <item>
      <title>Append works in 2.x but not 3.x</title>
      <link>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401017#M70176</link>
      <description>&lt;P&gt;Moving from older Desktop 2.x script to 3.x in Pro. For some reason, the script fails in 3.x when trying to Append. Two query tables are created with the exact same fields and joins from different layers.&amp;nbsp; One is created and written to a table, then the other one is created with a query table an appended to the first.Script has been working for years. Tried with and without the brackets.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.management.Append([lyrNameVN], finalTable,"NO_TEST")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is the ever helpful "ERROR 999999: Something unexpected caused the tool to fail"&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 17:15:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401017#M70176</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2024-03-26T17:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Append works in 2.x but not 3.x</title>
      <link>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401059#M70178</link>
      <description>&lt;P&gt;Not sure if related, but I run into issues trying to connect to my 10.6.1 eGDB's with arcpy running python 3.&amp;nbsp; Normally, just tells me that the data doesn't exist.&amp;nbsp; Have to revert to python 2.7 to do anything with the non-upgraded database.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 18:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401059#M70178</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-03-26T18:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Append works in 2.x but not 3.x</title>
      <link>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401073#M70179</link>
      <description>&lt;P&gt;Thanks for the comments&lt;/P&gt;&lt;P&gt;I'm using fGDB's. I thought it might be a fGDB version thing because the fGDB comes from an outside source. Unfortunately, the database is the proper version.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 18:35:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401073#M70179</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2024-03-26T18:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Append works in 2.x but not 3.x</title>
      <link>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401126#M70180</link>
      <description>&lt;P&gt;I figured it out. Gotta love the 999999 error. It should have said the table schemas to not match.&lt;/P&gt;&lt;P&gt;See the definition for the query table below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    tableList = ['{}\PropertyIndex'.format(src_fgdb),\
                    '{}\SiteLocation'.format(src_fgdb),
                    '{}\Parcels'.format(src_fgdb),\
                    '{}\LegalDescription'.format(src_fgdb),\
                    '{}\PropertyOwnership'.format(src_fgdb)]                    

    fieldList = [["PropertyIndex.OBJECTID",'OBJECTID'],\
                       ["PropertyIndex.ParcelID",'ParcelID'],\
                    ["SiteLocation.StreetDirection",'StreetDirection'],\
                    ["SiteLocation.StreetName",'StreetName'],\
                    ["SiteLocation.StreetWay",'StreetWay'],\
                    ["SiteLocation.UnitNumber",'UnitNumber'],\
                    ["SiteLocation.LocationCity",'LocationCity'],\
                    ["SiteLocation.LocationPostal",'LocationPostal'],\
                    ["SiteLocation.SiteAddress",'SiteAddress'],\
                    ["PropertyOwnership.OwnerFirstName",'OwnerFirstName'],\
                    ["PropertyOwnership.OwnerLastName",'OwnerLastName'],\
                    ["PropertyOwnership.Owner2FirstName",'Owner2FirstName'],\
                    ["PropertyOwnership.Owner2LastName",'Owner2LastName'],\
                    ["PropertyOwnership.Owner3FirstName",'Owner3FirstName'],\
                    ["PropertyOwnership.Owner3LastName",'Owner3LastName'],\
                    ["PropertyOwnership.Street1",'Street1'],\
                    ["PropertyOwnership.Street2",'Street2'],\
                    ["PropertyOwnership.City",'City'],\
                    ["PropertyOwnership.StateProvince",'StateProvince'],\
                    ["PropertyOwnership.PostalCodeFull",'PostalCodeFull'],\
                    ["PropertyOwnership.Country",'Country'],\
                    ["LegalDescription.LegalDescription",'LegalDescription'],\
                    ["PropertyIndex.PropertyID",'PropertyID'],\
                    ["Parcels.XCOORD",'XCOORD'],\
                    ["Parcels.YCOORD",'YCOORD'],\
                    ["SiteLocation.LocationStartNumber",'LocationStartNumber'],\
                    ["Parcels.isConfidential",'isConfidential'],\
                    ["Parcels.PropLatitude",'PropLatitude'],\
                    ["Parcels.PropLongitude",'PropLongitude']]

    whereClause = "PropertyIndex.PropertyID = Parcels.AccountNumber and "\
                    "PropertyIndex.PropertyID = SiteLocation.PropertyID and "\
                    "PropertyIndex.PropertyID = LegalDescription.PropertyID and "\
                    "PropertyIndex.PropertyID = PropertyOwnership.PropertyID and "\
                    "SiteLocation.LocationCity = 'Port Saint Lucie'"


    keyField = "PropertyIndex.OBJECTID"
    lyrNamePN = "SphinxPN" 
    arcpy.management.MakeQueryTable(tableList, lyrNamePN,"USE_KEY_FIELDS", keyField, fieldList, whereClause)        
    arcpy.management.CopyRows(lyrNamePN, finalTable) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using using 2.x (Desktop), the field name is just the second name in the field item.&lt;/P&gt;&lt;P&gt;["Parcels.PropLatitude",'PropLatitude'] would be written to the fGDB as PropLatitude.&lt;/P&gt;&lt;P&gt;When using using 3.x (Pro), the field would be written to the fGDB as Parcels_PropLatitude.&lt;/P&gt;&lt;P&gt;So in 3.x, the two feature classes would produce different fields while in 2.x the fields are the same.&lt;/P&gt;&lt;P&gt;see the attached image.&lt;/P&gt;&lt;P&gt;Have to use a field map to resolve.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 20:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-works-in-2-x-but-not-3-x/m-p/1401126#M70180</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2024-03-26T20:00:19Z</dc:date>
    </item>
  </channel>
</rss>

