On Tue, Sep 22, 2009 at 11:31:16AM -0500, logan.rat...@emerson.com scratched on
the wall:
> > I am having problems with the update command (through the interface
> > library). In most databases if you issue an update to a record that
> > does not exist, it simply adds a new record. When I try
On 22 Sep 2009, at 5:06pm, Barton Torbert wrote:
> I am having problems with the update command (through the interface
> library).
Which interface library ? The sqlite3_ C calls ? Or a library or API
for some other language ?
> In most databases if you issue an update to a record that
>You can't do that with an 'update' but you can with 'insert or
replace.'
>This is true in any SQL driven database, not just SQL.
(Er, that should read 'not just SQLite.')
Logan Ratner | Software Engineer | Gas Chromatographs
Emerson Process Management | 5650 Brittmoore Rd | Houston | TX | 77041
>From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users->boun...@sqlite.org] On Behalf Of Barton Torbert
>Sent: Tuesday, September 22, 2009 11:07 AM
>To: General Discussion of SQLite Database
>Subject: [sqlite] Update vs Insert
>
>Hello,
>
>I am having problems with
Barton Torbert wrote:
> I am having problems with the update command (through the interface
> library). In most databases if you issue an update to a record that
> does not exist, it simply adds a new record.
No database I've ever heard of does that. It must be a feature
Hello,
I am having problems with the update command (through the interface library).
In most databases if you issue an update to a record that does not exist, it
simply adds a new record. When I try this in SQLite I get an error back.
Is the SQLite update restricted to a record you know
Hi everyone!
I'm trying to solve the following problem... Suppose every access to the
database is made as INSERTs (even UPDATEs). Whenever someone tries to insert
something ovver an existing row (i.e., same PK), that insert should be
treated as an update.
Example:
CREATE TABLE X ( c1 varchar,
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
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
Am 27.06.2006 um 22:15 schrieb [EMAIL PROTECTED]:
My brain does not seem to be able to function properly today. I can
think
of many ways to do what I want to do but none of them I like.
I will describe the problem in the most symplistic form.
I have two tables. The first table, has a row
My brain does not seem to be able to function properly today. I can think
of many ways to do what I want to do but none of them I like.
I will describe the problem in the most symplistic form.
I have two tables. The first table, has a row which includes an 'id'
pointing to a row of another
20 matches
Mail list logo