Jim Crafton wrote:
well, the first time you update the row (and, you haven't said what
values you update it with), it succeeds because your WHERE clause
successfully matches.
I'm using the sqlite3_bind functions to modify the values.
Second time, the WHERE clause doesn't match because you have changed
the values. For example, if the first time you went and changed the
value of FirstName to 'Jane', the second time around your WHERE clause
won't match.
I'm keeping this in mind. I'm retaining the old value prior to the
change, what SELECT returns back to me.
You might find thins a lot easier if you set a primary key in the
table, and use that to match the rows.
Agreed, but I'm trying to make this work for the general case, where I
can't assume anything about the design/layout of the tables.
The problem is not with the new values in the SET clause, but with the
old values that are hard coded in the WHERE clause.
UPDATE Person SET LastName=?, FirstName=?, Address=?, Age=?
WHERE LastName='Doe' AND FirstName='John' AND Address='100 Nowhere
Ave.' AND Age=45;
You should change this to
UPDATE Person SET LastName=?, FirstName=?, Address=?, Age=?
WHERE LastName=? AND FirstName=? AND Address=? AND Age=?;
And supply all the values as parameters.
HTH
Dennis Cote
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------