Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Python UpdateCursor (arcpy.da) question

$
0
0
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)
Attached Thumbnails
Click image for larger version

Name:	copy1.png‎
Views:	N/A
Size:	161.5 KB
ID:	27519   Click image for larger version

Name:	copy2.png‎
Views:	N/A
Size:	158.2 KB
ID:	27520  

Viewing all articles
Browse latest Browse all 2485

Trending Articles