Python UpdateCursor (arcpy.da) question

2576
3
09-17-2013 09:05 AM
by Anonymous User
Not applicable
Original User: chyang0107

Hi All,

I have a question with my script (listed below). This script does not work when one field is GlobalID the other is Guid. I also have tested if one field is GlobalID the other is Text. It still does not work. Please let me know if you all have any suggestion.

Thanks,
Hank

import arcpy
from arcpy import env

env.overwriteOutput = True
env.workspace = "F:\\Mark\\DataModelChanges\\Geodatabase.gdb\\Geology"

fc = "ContactsAndFaults_line"
fields = ('GlobalID', 'ContactsAndFaults_ID')

# Create update cursor for feature class
#
   with arcpy.da.UpdateCursor(fc, fields) as cursor:
    # For each row, read the OldField value (index position
    #  of 0), and update NewField value (index position of 1)
    #
    for row in cursor:
        row[1] = row[0]

        # Update the cursor with the updated list
        #
        cursor.updateRow(row)
0 Kudos
3 Replies
by Anonymous User
Not applicable
Original User: JSkinn3

Hi Hank,

What version of ArcGIS are you running?  I believe you may be encountering the following bug, NIM087125.  This bug has been resolved in 10.2.

Also, when posting your code be sure to wrap it in CODE tags using the # symbol above.
0 Kudos
MichaelVolz
Esteemed Contributor
Jake:

Your response points to a link to NIM087125 which asks me to log into an ESRI webpage.  I use my ESRI credentials, but I cannot get into this website.  How else can I find out about this NIM as I cannot access it from the ESRI Customer Care page either (I can only see NIMs created by members of my organization)?
0 Kudos
by Anonymous User
Not applicable
Original User: JSkinn3

Jake:

Your response points to a link to NIM087125 which asks me to log into an ESRI webpage.  I use my ESRI credentials, but I cannot get into this website.  How else can I find out about this NIM as I cannot access it from the ESRI Customer Care page either (I can only see NIMs created by members of my organization)?


Try going to http://support.esri.com and searching for the NIM number.
0 Kudos