Select to view content in your preferred language

Python script to delete an item in RasterCatalog

869
1
06-01-2010 07:29 AM
MatthiasHofmann
New Contributor
Hello,
i am trying to delete one item of a raster catalog using python.
for this purpose, i use the following code:

# Create search cursor for RasterCatalog
where_clause = ' [Start_Time] IS NULL '
rows = arcpy.SearchCursor(RasterCatalog, where_clause)

for row in rows:
    rows.deleteRow(row)
del row
del rows

i am getting the following error message:
File ... line 97, in deleteRow  
return convertArcObjectToPythonObject(self._arc_object.DeleteRow(*gp_fixargs
(args)))
RuntimeError: ERROR 999999: Error executing function.

what does that mean? i am using 9.4 Beta.

Thank you,

Matthias
0 Kudos
1 Reply
KimOllivier
Honored Contributor
You can't delete rows with a SearchCursor, it is read-only.
Try an UpdateCursor
You might still encounter problems, Image catalogs seem to be special tables.
0 Kudos