Thanks Simon. I solved the issue by making sqlite3 *dbhandle = NULL then testing it for a null value afterwards. It works fine.
________________________________ From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> on behalf of Simon Slavin <slav...@bigfraud.org> Sent: Wednesday, 4 January 2017 9:47 AM To: SQLite mailing list Subject: Re: [sqlite] Can the Explain explain what is going on here? On 4 Jan 2017, at 12:09am, Bart Smissaert <bart.smissa...@gmail.com> wrote: > Secondly, can the Explain statement tell me that indeed the UDF runs 100000 > times in the first SQL and only once for the second SQL? What makes you think that this is the case ? Why would SQLite not be running the UDF 100000 times in both cases ? Did you build any caching of results into your UDF ? If not, then SQLite has no idea it can optimize it by checking to see if it's using the same parameters each time. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users> mailinglists.sqlite.org To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ... _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users