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
"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]>
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;
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
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
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.
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
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
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
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
10 matches
Mail list logo