I am trying to optimize a script that uses addJoin_management
. To do this efficiently, I am attempting to add an attribute index on the join table. I am getting a generic error when i do this though.
arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Failed to execute (AddIndex).
My code does an intersect, dissolve, calculate acres, join and then re-calculate the acres column to the target table.
EDIT: See below for my solution.
1 Answer 1
My Solution: I was never able to get the in_memory variable working with AddIndex_management. I ended up using the arcpy.env.scratchGDB.
# in_memory variables do not work with AddIndex Management
# dissolve_out = "in_memory" + "\\" + "mem_dissolved"
# The solution:
dissolve_out = os.path.join(arcpy.env.scratchGDB, "scratch_dissolve_out")
arcpy.AddIndex_management(dissolve_out ,"FID_Parcels_2013", "ID", "UNIQUE", "ASCENDING")
arcpy.AddIndex_management(dissolved,"FID_Parcels_2013", "ID", 1, 1)
rather than spelling out the 'unique' and 'ascending' options. Does "ID" stands for your index name? I run my data off disk so like @Hornbydd said it might be an in memory issue