> On Dec 13, 2016, at 8:01 PM, Igor Korot wrote:
>
> Yes, you are correct.
> Do you know how I can write such a code?
Just move the code that looks for statements into the " if( res != SQLITE_OK )”
block.
—Jens
___
sqlite-users
qlite.org>
Betreff: [sqlite] How do I check if the DB is open?
Hi, ALL,
I'm using following code to check for errors in debug mode:
int res = sqlite3_close( m_db );
if( res != SQLITE_OK )
{
// error handling
}
#ifdef DEBUG
sqlite3_stmt *statement = sqlite3_next_stmt
mber, 2016 17:55
To: Discussion of SQLite Database; General Discussion of SQLite Database
Subject: [sqlite] How do I check if the DB is open?
Hi, ALL,
I'm using following code to check for errors in debug mode:
int res = sqlite3_close( m_db );
if( res != SQLITE_OK )
{
// error handli
Jens,
On Tue, Dec 13, 2016 at 8:38 PM, Jens Alfke wrote:
>
>> On Dec 13, 2016, at 5:33 PM, Simon Slavin wrote:
>>
>> The only thing you should do if sqlite3_close() doesn’t work is to print an
>> error message which includes the value returned.
Nathan,
On Tue, Dec 13, 2016 at 8:36 PM, Nathan Bossett wrote:
> On Tue, Dec 13, 2016 at 08:20:44PM -0500, Igor Korot wrote:
>> > What more are you trying to find out?
>>
>> If I forget to finalize statement, I can use that sequence to find
>> which query is dangling.
>>
>>
>> -Original Message-
>> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
>> On Behalf Of Igor Korot
>> Sent: Tuesday, 13 December, 2016 17:55
>> To: Discussion of SQLite Database; General Discussion of SQLite Database
>> Subjec
Simon,
On Tue, Dec 13, 2016 at 8:33 PM, Simon Slavin wrote:
>
> On 14 Dec 2016, at 1:20am, Igor Korot wrote:
>
>> So are you saying that this code should be executed if sqlite3_close()
>> didn't return SQLITE_OK?
>
> Hold on. Closing the database is a
> On Dec 13, 2016, at 5:33 PM, Simon Slavin wrote:
>
> The only thing you should do if sqlite3_close() doesn’t work is to print an
> error message which includes the value returned. Because if you can’t close
> the database what are you going to do instead ?
Igor is
On Tue, Dec 13, 2016 at 08:20:44PM -0500, Igor Korot wrote:
> > What more are you trying to find out?
>
> If I forget to finalize statement, I can use that sequence to find
> which query is dangling.
>
> So are you saying that this code should be executed if sqlite3_close()
> didn't return
On Behalf Of Igor Korot
> Sent: Tuesday, 13 December, 2016 17:55
> To: Discussion of SQLite Database; General Discussion of SQLite Database
> Subject: [sqlite] How do I check if the DB is open?
>
> Hi, ALL,
> I'm using following code to check for errors in debug mode:
>
>
On 14 Dec 2016, at 1:20am, Igor Korot wrote:
> So are you saying that this code should be executed if sqlite3_close()
> didn't return SQLITE_OK?
Hold on. Closing the database is a special case.
The only thing you should do if sqlite3_close() doesn’t work is to print an
Hi, Nathan,
On Tue, Dec 13, 2016 at 8:03 PM, Nathan Bossett wrote:
> I'm not sure exactly what you're trying to do, but if sqlite3_close()
> returns SQLITE_OK then it closed and if it returns SQLITE_BUSY then it's
> not closed but possibly in a messy state (my selects have
I'm not sure exactly what you're trying to do, but if sqlite3_close()
returns SQLITE_OK then it closed and if it returns SQLITE_BUSY then it's
not closed but possibly in a messy state (my selects have default handling
too but I think those are the only defined responses). If you know it
Hi, ALL,
I'm using following code to check for errors in debug mode:
int res = sqlite3_close( m_db );
if( res != SQLITE_OK )
{
// error handling
}
#ifdef DEBUG
sqlite3_stmt *statement = sqlite3_next_stmt( m_db, NULL );
if( statement )
const char *query =
14 matches
Mail list logo