I want to delete some tables from my SDE as well as some featureclasses located in a feature-dataset. As some of those tables and featureClasses are enabled for archiving I get both the base-table/FC and its archive in two seperate steps. However I wonder if I cannot get both in one single step?
This is the code I currently use (step 1)
result = arcpy.ListTables(user + ".KS*") # get the tables beginning with KS for ds in arcpy.ListDatasets(user + ".KOM_*"): # get the FDS beginning with KOM for fc in arcpy.ListFeatureClasses(None, None, ds): result.extend([fc]) result.extend([ds])
Now I want to append all the archive-tables also (step 2):
for ds in result: if arcpy.Describe(ds).IsArchived: result.extend([ds])
However this loop never terminates. Obviously everytime we find an archived table we add it to the result and re-iterate the whole loop.
After all I delete all the datasets within my list using
for ds in result: arcpy.Delete_management(ds)
Does anyone know how I may add the archive-tables also to my list?