Is a table in ArcMap a layer or a tableview. I want to be able to feed a table into an UpdateCursor via a toolbox script. If my table has a definition query on it how do I check for that with python?
A table is a table. Look at the Dataset properties docs. Here is a describe on a Excel sheet:
>>> import arcpy >>> desc = arcpy.Describe("Sheet1$") >>> print desc.datasetType Table
And here is how you get the definition query, again with a describe:
>>> desc = arcpy.Describe("Sheet1$") >>> dq = desc.whereClause >>> dq u"`F2` = 'Downloaded data'" >>>
EDIT: blah238 is correct:
>>> desc = arcpy.Describe("Sheet1$") >>> print desc.dataType TableView
Thanks @blah238. I found this arcpy.mapping.ListTableViews(mxd, "", df): which is what I was looking for here