If you run a query that returns no results, then cursor.fetchone() will return None, or cursor.fetchall() will return an empty list. If there is an error during the processing then some sort of exception should be raised.
-----Original Message----- From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> On Behalf Of Rob Sciuk Sent: Wednesday, September 04, 2019 2:18 PM To: sqlite-users@mailinglists.sqlite.org Subject: [sqlite] Differentiate between an empty result set and an error using Python3 Forgive me if this is an FAQ, but in looking over the python3 interface to SQLITE3, I cannot see a way to get the result code (SQLITE_OK) after an execute() command. My use case is to differentiate between an empty row set (OK) vs an error of some kind in the query. Anyone figured this out? Cheers, Rob. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Robert S. Sciuk r...@controlq.com Principal Consultant 905.706.1354 Control-Q Research 97 Village Rd. Wellesley, ON N0B 2T0 _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users