>>> cur = arcpy.da.SearchCursor(featureclass,["globalid"]) >>> row = cur.next() Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: unsupported field type GLOBALID #11
>>> cur = arcpy.da.SearchCursor(featureclass,["globalid@"]) >>> row = cur.next() Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: A column was specified that does not exist.
>>> cur = arcpy.SearchCursor(featureclass) >>> row = cur.next() >>> row.globalid u'{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}' >>> row.getValue("globalid") u'{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}'
>>> cur = arcpy.SearchCursor(featureclass, fields="GlobalID")
Hi Mike,
This is a bug and has been logged:
NIM084842: Support GlobalID field type with arcpy.da.SearchCursor.
You can follow the status of this bug on support.esri.com.
We haven't tried 10.2 yet - can anyone verify this is still a problem? I presume from the (lack of) status update that it is.
fc = 'name of fc in TOC' cur = arcpy.da.SearchCursor(fc,["GlobalID"]) row = cur.next() print row[0]
This doesn't appear fixed in 10.4.1 in 2017,
I don't have access to a 10.4.1 machine at the moment, but I just tested the code from xander_bakker's Nov. 5, 2013 comment using ArcGIS 10.5 and it works.
Weird, I tested it again, using your code, but it throws an exception in 10.4.1.
Out of curiosity, what is the error message text?