AddIndex_management error:

3847
2
03-18-2011 08:38 AM
NathanielRoth
New Contributor III
Can anyone tell me why the following python exported directly from a Geoprocessing Model that works does not work?
The error message:
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000530: Value is required


I am replacing tst.dbf with a fresh copy before running it in python.

Thank you,
Nate



# Import arcpy module
import arcpy


# Local variables:
tst_dbf = "C:\\Users\\roth\\Desktop\\MIP_Training\\Outputs\\tst.dbf"
tst_View = "tst_View"

# Process: Make Table View
arcpy.MakeTableView_management(tst_dbf, tst_View, "", "", "OID OID VISIBLE NONE;BKGPIDFP00 BKGPIDFP00 VISIBLE NONE;FREQUENCY FREQUENCY VISIBLE NONE;SUM_area_z SUM_area_z VISIBLE NONE")

# Process: Add Attribute Index
arcpy.AddIndex_management(tst_View, "BKGPIDFP00", "#", "NON_UNIQUE", "NON_ASCENDING")
0 Kudos
2 Replies
KentBurley
New Contributor
Hi,
A long delay to the answer of this question, but for those who come here in the future to find an answer, the index needs to be named.  "An index name is necessary when adding an index to geodatabase feature classes and tables. For other data types, such as shapefiles and coverage feature classes, index names cannot be specified." IE, So replace '#' with 'MYINDEX' as an example.
Thanks
0 Kudos
JoePlattner
New Contributor III

Just to add my two cents. This discussion was helpful. At first glance the help document for the AddIndex_management makes it looks like it's optional when as mentioned above it is required of Geodatabases.Capture.JPG