Re: [sqlite] Update and insert questions

2007-02-16 Thread P Kishor
On 2/16/07, Jim Crafton <[EMAIL PROTECTED]> wrote: > but it fails because the embedded WHERE clause is no longer catching > the row. It is still looking for > > WHERE LastName='Doe' AND > FirstName='John' AND > Address='100 Nowhere Ave.' AND > Age=45; > > instead of > > WHERE

Re: [sqlite] Update and insert questions

2007-02-16 Thread drh
"Jim Crafton" <[EMAIL PROTECTED]> wrote: > So I guess the moral of this is to use bind cautiously :) > Bind is usually considered the safer way of doing things since it make SQL injection attachs much less likely. -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] Update and insert questions

2007-02-16 Thread Jim Crafton
but it fails because the embedded WHERE clause is no longer catching the row. It is still looking for WHERE LastName='Doe' AND FirstName='John' AND Address='100 Nowhere Ave.' AND Age=45; instead of WHERE LastName='Doe' AND FirstName='Jane' AND Address='100 Nowhere Ave.' AND Age=45;

Re: [sqlite] Update and insert questions

2007-02-16 Thread Dennis Cote
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

Re: [sqlite] Update and insert questions

2007-02-16 Thread Dennis Cote
Jim Crafton wrote: I thought that the plain "?" character was an indicator that you were going to modify the column value via the sqlite3_bindXXX functions. You are correct. These parameters should not be quoted. Dennis Cote

Re: [sqlite] Update and insert questions

2007-02-16 Thread P Kishor
I guess I wasn't clear (either that, or I am not understanding what you are doing). Let's try again (and, it doesn't matter that you are using sqlite3_bind; I am just talking workflow here). You have the following row -- Doe John 100 Nowhere Ave.

RE: [sqlite] Update and insert questions

2007-02-16 Thread RB Smissaert
I did say I was nearly new to SQLite. RBS -Original Message- From: Jim Crafton [mailto:[EMAIL PROTECTED] Sent: 16 February 2007 16:28 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Update and insert questions On 2/16/07, RB Smissaert <[EMAIL PROTECTED]> wrote: > Nearly new

Re: [sqlite] Update and insert questions

2007-02-16 Thread Jim Crafton
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

Re: [sqlite] Update and insert questions

2007-02-16 Thread Jim Crafton
On 2/16/07, RB Smissaert <[EMAIL PROTECTED]> wrote: Nearly new to SQLite as well, but shouldn't this: UPDATE Person SET LastName=?, FirstName=?, Address=?, Age=? Be altered to this: UPDATE Person SET LastName='?', FirstName='?', Address='?', Age='?' I thought that the plain "?" character

Re: [sqlite] Update and insert questions

2007-02-16 Thread P Kishor
On 2/16/07, Jim Crafton <[EMAIL PROTECTED]> wrote: 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