inputField = arcpy.ListFields(inputLayer, inputFieldName)[0] fieldType = inputField.type
I'm not sure exactly how GUIDs work but I'm assuming the actual field value is just a reference to a value stored in the geodatabase, similar to a domain.[/INDENT]
# Begin bug patch of Guid showing as ShortInt rows = arcpy.SearchCursor(layer) for row in rows: TestString = str(row.getValue(fieldName)) # use str() in case this really is a Short if (TestString[0] == "{"): # a "{" character has no business in a *real* Short valueDelimiter = "'" # End bug patch of Guid showing as ShortInt
Yes but the string is registered with the geodatabase, it does not necessarily have to be the value stored in the field.
desc.globalIDFieldName desc.hasGlobalID
I'm seeing this same error with 10.2.1, seems like a bug, here's the result from the describe function
>>> for fld in desc.fields:
... print(fld.name + " " + fld.type)
...
OBJECTID OID
COMMENTS String
NAME String
YEARESTABLISHED Date
MXPARENTLOC String
CREATEEDITOR String
CREATEDATE Date
LASTEDITOR String
LASTEDITDATE Date
Shape Geometry
GlobalID SmallInteger
Shape.STArea() Double
Shape.STLength() Double
>>>
but the field shows as a GlobalId type in ArcCatalog
What is the back-end data store? SQL Server, Oracle, PostgreSQL?
I did a quick check using ArcGIS 10.5 with an enterprise geodatabase in SQL Server, and the results are correct with ArcPy Describe.
Might be fixed in 10.5, but with 10.2 with Sql Server backend enterprise gdb the issue occurs.
A.J.