Re: [sqlite] If row exists use UPDATE else INSERT

2008-08-15 Thread Igor Tandetnik
Javier Julio <[EMAIL PROTECTED]> wrote: > Reading that carefully I figure that means if I have a record in the > ideas table with an ideaId of 5 and I perform an INSERT with that same > ideaId of 5 (remember I always provide the id as I want to use the id > from the server) then it removes that

Re: [sqlite] If row exists use UPDATE else INSERT

2008-08-15 Thread cmartin
On Fri, 15 Aug 2008, Javier Julio wrote: > Is it possible in SQLite to have a single statement that basically > says if this row exists run an UPDATE statement, if not run an INSERT? You can INSERT rows that don't already exist. For example, the following creates 2 tables, FOO and BAR that

Re: [sqlite] If row exists use UPDATE else INSERT

2008-08-15 Thread Javier Julio
> > Javier Julio <[EMAIL PROTECTED]> wrote: >> Is it possible in SQLite to have a single statement that basically >> says if this row exists run an UPDATE statement, if not run an >> INSERT? > > In some situations, depending on your definition of "exists", INSERT > OR > REPLACE statement may

Re: [sqlite] If row exists use UPDATE else INSERT

2008-08-15 Thread Igor Tandetnik
Javier Julio <[EMAIL PROTECTED]> wrote: > Is it possible in SQLite to have a single statement that basically > says if this row exists run an UPDATE statement, if not run an INSERT? In some situations, depending on your definition of "exists", INSERT OR REPLACE statement may be suitable:

[sqlite] If row exists use UPDATE else INSERT

2008-08-15 Thread Javier Julio
Hey everyone. Just signed up last night and had skimmed through several of the archives. Excited to partake in future discussions. I'm just taking the plunge into SQLite since I'm working with Adobe AIR and Flex. I'm building a desktop app that will sync data to a SQLite database. I have