You need a call to sqlite_exec() too. 

-----Original Message-----
From: Holger Brunck [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 24, 2004 5:44 PM
To: [EMAIL PROTECTED]
Subject: [sqlite] Problems with the C interface

Hi,
I'm using sqlite 2.8.12 and have a problem in deleting rows from a
database.
The sql statement which don't work in my C++ code was:
C++ Code Segment:
sql = "DELETE FROM table_1 WHERE path='/daten2/documents/my_file.txt';";
if(SQLITE_OK != sqlite_compile(db, sql, &sqltail, &dbcursor, &dberr)) {
        cout << "Error:" << dberr << endl;
        free (dberr);
}
else
{
       cout << "Success:" << endl;
       sqlite_finalize(dbcursor, NULL);
}

The code segment returns a Success, but the matching file won't be
deleted from the database. Other sql statements are working verry well.
When I try to use the sqlite program instead of invoking the command via
the C interface and enters the command per command line it was removed
out of the
database:
sqlite> DELETE FROM table_1 WHERE path='/daten2/documents/my_file.txt';

Know the file was removed out of the database.
Any hints are welcome.

Kind Regards
Holger

Reply via email to