AnsweredAssumed Answered

arcpy.da.searchcursor with expression

Question asked by bschwarz on May 13, 2013
Latest reply on May 14, 2013 by bschwarz
Just wondering if anyone has had any trouble with using a query expression with arcpy.da.searchcursor?

I've used this successfully many time but I have code where I create table views from tables in a fGDB then use a cursor on selected records using arcpy.da.searchcursor.

One of these works fine while the other does not reduce the number of records from the total records in the table.

I've stared at this for a while and really don't see a reason why one would work and the other does not.

The only think I can think of is that the table view that does NOT work has a joined table associated with it using AddJoin.

Otherwise there is no significant difference that I can see between the two.



One other thing I did try was to using CopyRows to copy the table view to a table, use MakeTableView using the same query expression used above in the arcpy.da.searchcursor, and then use CopyRows to a copy the view to table.  After this runs, the final table copied behaves as if the query was not applied (same as happens in arcpy.da.searchcursor).

any leads appreciated.

Outcomes