Ah sorry, my mistake.
I think you need to actually call sqlite_step for the DELETE to take
effect though. 

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

> You need a call to sqlite_exec() too.
Why do I need this ? I am using the second possibility to execute sql
commands instead of the sql_exec() command and in other cases it works
very well:
sqlite_compile();
sqlite_step();
sqlite_finalize();

In my case I skip the sqlite_step() command, but I assume that the
sqlite_compile() command is the important one.

> -----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 
> sqlite> 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