Any idea why the input requirements for adding a string/text field is different than the 'type' attribute for a string/text field?
For example:
----
myfc = r'C:\Foo\bar.gdb\somefc'
arcpy.AddField_management(myfc, 'MyStringField', 'TEXT',5)
myfc_pyobject = arcpy.ListFields(myfc,'MyStringField')[0]
------
myfc_pyobject.type would print out 'String'
Seems like they should be the same.
Thanks
George
Solved! Go to Solution.
Consistency would be great, but this is covered/addressed in the Field—Help | ArcGIS Desktop :
The field type.
- Blob —Blob
- Date —Date
- Double —Double
- Geometry —Geometry
- GlobalID —Global ID
- Guid —Guid
- Integer —Integer (Long Integer)
- OID —Object ID
- Raster —Raster
- Single —Single (Float)
- SmallInteger —Small Integer (Short Integer)
- String —String (Text)
Similar/same data types aren't always called the same thing in different systems, and ArcGIS has to balance data type names between ArcObjects, Python, DBMSs, etc.... I think "string" is more common in programming languanges but "text" is more user friendly.
Consistency would be great, but this is covered/addressed in the Field—Help | ArcGIS Desktop :
The field type.
- Blob —Blob
- Date —Date
- Double —Double
- Geometry —Geometry
- GlobalID —Global ID
- Guid —Guid
- Integer —Integer (Long Integer)
- OID —Object ID
- Raster —Raster
- Single —Single (Float)
- SmallInteger —Small Integer (Short Integer)
- String —String (Text)
Similar/same data types aren't always called the same thing in different systems, and ArcGIS has to balance data type names between ArcObjects, Python, DBMSs, etc.... I think "string" is more common in programming languanges but "text" is more user friendly.
Thanks, I've probably seen that part of the help 100s of times but never actually digested the 'String to TEXT' part in the note.
Thanks
George