AnsweredAssumed Answered

Making more Complex SQL Queries with Arcpy SearchCursor

Question asked by lawGIS45 on Mar 21, 2020
Latest reply on Mar 22, 2020 by bixb0012

Hello everyone,

 

 I am writing a python script and want to perform the following query using arcpy's SearchCursor:

select unique name, corridor, pnt, zone where not (name is null or corridor is null or pnt is null or zone is null)

 

I did try making the SearchCursor's where_clause = (name is null or corridor is null or pnt is null or zone is null), but the script could not run like that and gave an error. I am using the following code to query the arcgis data successfully but not getting the data the way I need it:

 

with arcpy.da.SearchCursor(gdbConnectTable, fieldsList) as readCursor:
    for record in readCursor:

 

I have not been able to find any documentation on getting SearchCursor to yield unique results.

 

Is it possible to have the arcpy SearchCursor return what I need?

Outcomes