Thanks Simon. Used this

        string str;
        sqlite3_stmt *stmt=NULL;
        do
        {
                stmt=sqlite3_next_stmt(FSQLiteDB,stmt);
                if (stmt) str+=string(sqlite3_sql(stmt))+"\r\n";
        }
        while (stmt);



________________________________
From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> on behalf of 
Simon Slavin <slav...@bigfraud.org>
Sent: Tuesday, November 5, 2019 7:55:12 PM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] Find stmt that's stopping a DB from closing

On 5 Nov 2019, at 7:27pm, x <tam118...@hotmail.com> wrote:

> I’m sure the team added a fct that listed the offenders but I can’t find it 
> in the documentation.

The first statement associated with an open connection is pointed to by the 
pStmt of that connection.  Once you've found the first statement call

sqlite3_next_stmt()

on it to find the next one.

<https://www.sqlite.org/c3ref/next_stmt.html>

Unfortunately the database connection is documented as 'opaque'.  I'm not 
certain for the ideal way in C to get the first statement from it.

Simon
--
 http://www.bigfraud.org     | I'd expect if a computer was involved
 No Buffy for you.           | it all would have been much worse.
 Leave quickly now. -- Anya  |                -- John "West" McKenna

_______________________________________________
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

Reply via email to