How to add a GLOBALID type field to a feature layer by Python?

488
3
12-22-2010 08:24 AM
SuiHuang
Occasional Contributor II
Hi Experts:

    I am writing a Python script to add fields to a layer in file geodatabase.
    I want to add a field of GLOBALID type, but the Add Field geo-processing tool in ArcGIS 9.2 only support TEXT |FLOAT|DOUBLE|SHORT|LONG|DATE |BLOB|RASTER

    http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=Add_Field_(Data_Management)

    Is there any way for me to let the script add a GLOBALID field for me?
    Thank you.
Tags (2)
0 Kudos
3 Replies
ChrisSnyder
Regular Contributor III
In v9.3 use the "GUID" field type keyword (even though the Help says it's not there it really is!). For example:

gp.AddField_management(t3FC, "GLOBAL_UID", "GUID")
0 Kudos
SuiHuang
Occasional Contributor II
Hi Chris:

Thank you for your note. Unfortunately I am using ArcGIS 9.2, is there any way to make it work?
Happy new year.
0 Kudos
ChrisSnyder
Regular Contributor III
I don't have any machines still running v9.2, so I can't verify if the "GUID" keyword works there or not...

Time to upgrade?
0 Kudos