OK, please bear with me here, as I'm very much of an SQL newbie.

I'm writing a wrapper around sqlite.
I want the to code to be able to modify a given value (column) of a
specific row. To do this, as I understand it, I need to use the SQL
UPDATE statement coupled with a WHERE clause. So assuming the
following table :
CREATE TABLE Person
(
LastName varchar,
FirstName varchar,
Address varchar,
Age int
);


With a single row of:
Doe                   John                     100 Nowhere Ave.          45

I want to change "John" to "Bob".

If I want to update this, I would write
UPDATE Person SET LastName=?, FirstName=?, Address=?, Age=?
WHERE LastName='Doe' AND FirstName='John' AND Address='100 Nowhere
Ave.' AND Age=45;

I then use the sqlite bind APIs to change values accordingly.

The first time I execute this in sqlite, the sql execution succeeds.
The second time I execute this there is no change to the DB, but the
API calls don't return any error code!
If I change the "=" operator in the WHERE clause to "like" then the
operation makes the change to the DB.

Is there something strange going on? I notice that if I then run some
external tool (like sqlite3Explorer) and run SQL statements directly,
the update statement with the "=" fails, and I get weird errors from
the tool if I use the GUI to edit the row.

Is there something that is being corrupted in the db file?

Thanks

Jim C

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to