<?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: Insert cursor fails when data includes a GlobalID field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1201889#M65287</link>
    <description>&lt;P&gt;Just yesterday I had to append data from our test environment to production and had to redo all the relationships because the GlobalID values were changed. I had no idea this setting existed.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 14:19:04 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2022-08-11T14:19:04Z</dc:date>
    <item>
      <title>Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1201711#M65278</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I'm using an arcpy&lt;STRONG&gt; insert cursor&lt;/STRONG&gt; in ArcMap 7.1 to add features to an in_memory feature class, and this works fine except when the source feature class includes an indexed GlobalID field.&amp;nbsp; The error I receive is "SystemError: error return without exception set".&lt;/P&gt;&lt;P&gt;If I use FeatureClassToFeatureClass to convert the source FC to a new feature class, and drop the GlobalID field, the insert works fine again.&lt;/P&gt;&lt;P&gt;The &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/the-in-memory-workspace.htm" target="_self" rel="nofollow noopener noreferrer"&gt;in_memory guidance&lt;/A&gt; warns that in_memory "does not support extended geodatabase elements such as subtypes, domains, representations, topologies, geometric networks, and network datasetsabout", but I don't see anything about GlobalIDs being an issue.&amp;nbsp; Any insights would be appreciated.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 11 Aug 2022 01:16:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1201711#M65278</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2022-08-11T01:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1201730#M65280</link>
      <description>&lt;P&gt;If you want to save the globalids from the previous dataset, try setting the preserve global id setting in arcpy env.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/environment-settings/preserve-globalids.htm" target="_blank" rel="noopener"&gt;preserve-globalids&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Set the preserveGlobalIds environment to True
arcpy.env.preserveGlobalIds = True&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 02:36:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1201730#M65280</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-08-11T02:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1201889#M65287</link>
      <description>&lt;P&gt;Just yesterday I had to append data from our test environment to production and had to redo all the relationships because the GlobalID values were changed. I had no idea this setting existed.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 14:19:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1201889#M65287</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-08-11T14:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202205#M65291</link>
      <description>&lt;P&gt;So, GlobalIDs are managed by the system so you should not be trying to insert them. If you want to move them around you can use&amp;nbsp;@Anonymous User&amp;nbsp;method to preserve global ID's. Or if you like you can add a new field of data type GUID and then insert ID's in there. Of, course if you do so the new GUID field will no longer be managed by the system - it will be on you to keep it updated.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 21:50:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202205#M65291</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2022-08-11T21:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202881#M65315</link>
      <description>&lt;P&gt;Thanks for the replies, but I think my issue has been misinterpreted.&amp;nbsp; Apologies if it was unclear.&lt;/P&gt;&lt;P&gt;In this case, I'm not concerned with the transfer, or the values, of GlobalIDs.&lt;/P&gt;&lt;P&gt;Rather, I'm trying to understand why my insert cursor does not work when the inserted record (I'm inserting an entire record, not just a value) contains a GlobalID field and the insert cursor's target is an in_memory feature class.&amp;nbsp; The cursor works as expected if no GlobalID field is present.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 15:35:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202881#M65315</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2022-08-15T15:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202925#M65316</link>
      <description>&lt;P&gt;It will throw an error for the entire record because the process is an all or nothing transaction.&lt;/P&gt;&lt;P&gt;I can't tell what fields are available in the in_memory fc, or what fields the cursor has, or what fields are being mapped/ assigned. Generally, you can leave the GlobalID field index (i.e. row[20]) empty and it will create its own value on insertion. Maybe sharing how you have the cursor set up would help explain it better.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 16:08:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202925#M65316</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-08-15T16:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202927#M65317</link>
      <description>&lt;P&gt;My, guess is this. Because they GlobalID field is system managed it will not let you insert a value into it. It would be like you trying to create your own object ID's. It is just not something you can do. So, remove the field from your insert or create a target field of type GUID.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 16:09:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1202927#M65317</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2022-08-15T16:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Insert cursor fails when data includes a GlobalID field</title>
      <link>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1204878#M65375</link>
      <description>&lt;P&gt;OK, that makes sense &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;forestknutsen1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;JeffK - Fields in the in_memory fc are cloned from the source fc via a field list, so I just modified construction of the field list to omit GlobalID, if it is present, as illustrated below.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;fieldList = []&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;fields = arcpy.ListFields(inSec)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;for field in fields:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; if field.type != "GlobalID":&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldList.append(field.name)&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 04:07:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insert-cursor-fails-when-data-includes-a-globalid/m-p/1204878#M65375</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2022-08-22T04:07:11Z</dc:date>
    </item>
  </channel>
</rss>

