I have a sql statement that returns no hits. For example, \'select * from TAB where 1 = 2\'.
\'select * from TAB where 1 = 2\'
I want to check how many rows are returned,
cu
if you're connecting to a postgres database, the following works:
result = cursor.execute(query) if result.returns_rows: # we got rows! return [{k:v for k,v in zip(result.keys(), r)} for r in result.rows] else: return None