--- RB Smissaert <[EMAIL PROTECTED]> wrote:
> Thanks, that is how I understood it to be.
> I must be overlooking something simple here.

Check your SELECT sub-statement within the REPLACE statement to see 
what rows it returns.

.header on
.mode tabs

create table t1(id primary key, e2_a, e2_b, e3_a, e3_b);
insert into t1 values(3, 30,31, 23,230);
insert into t1 values(4, 40,41, 24,240);
insert into t1 values(5, 50,51, 25,250);

create table e2(id primary key, a, b);
insert into e2 values(3, 300, 310);
insert into e2 values(4, 400, 410);
insert into e2 values(5, 500, 510);

create table e3(id primary key, a, b);
insert into e3 values(3, 23.1, 230.1);
insert into e3 values(4, 24.1, 240.1);
insert into e3 values(5, 25.1, 250.1);

select * from t1 order by id;

replace into t1(id, e2_a, e2_b, e3_a, e3_b)
  select t1.id, e2.a, e2.b, e3.a, e3.b
  from t1, e2, e3 
  where t1.id = e2.id and t1.id = e3.id;

select * from t1 order by id;

id      e2_a    e2_b    e3_a    e3_b
3       30      31      23      230
4       40      41      24      240
5       50      51      25      250

id      e2_a    e2_b    e3_a    e3_b
3       300     310     23.1    230.1
4       400     410     24.1    240.1
5       500     510     25.1    250.1


> 
> RBS
> 
> -----Original Message-----
> From: Gerry Snyder [mailto:[EMAIL PROTECTED] 
> Sent: 29 January 2007 23:52
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Limit statement size?
> 
> RB Smissaert wrote:
> > Had a go at this, but sofar I haven't been able yet to get it to work.
> > I get no error, but A3Test115_J remains just at it is.
> > I couldn't find much information about INSERT OR REPLACE in the SQLite
> > documentation. What exactly should it do?
> 
> It will try to do an INSERT. If the PATIENT_ID field is already in the 
> file, it will delete the old conflicting entry before inserting.
> 
> The best write-up is at:
> 
> http://sqlite.org/lang_conflict.html
> 
> 
> HTH,
> 
> Gerry



 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to