Re: [sqlite] INSERTing records in two tables?

2008-02-11 Thread Dennis Cote
Gilles wrote: > > I'm an SQL newbie, and would like to know how to perform the following > INSERT's: > > BEGIN; > INSERT INTO customers (id,name) VALUES (NULL,'John Doe'); > ;How to get ROW_ID? > INSERT INTO phones (tel,id_customers) VALUES ('1234567',ROW_ID); > COMMIT; > Gilles, In this

Re: [sqlite] INSERTing records in two tables?

2008-02-09 Thread John Stanton
last_row_id is not a function. It is a predefined value. Gilles wrote: > On Sat, 9 Feb 2008 08:41:56 -0500, "Igor Tandetnik" > <[EMAIL PROTECTED]> wrote: >> INSERT INTO phones (tel,id_customers) VALUES ('1234567',last_row_id()); > > Thanks, but I'm getting an error (FWIW, I'm using 3.5.4): > >

Re: [sqlite] INSERTing records in two tables?

2008-02-09 Thread Igor Tandetnik
"Gilles" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 9 Feb 2008 08:41:56 -0500, "Igor Tandetnik" > <[EMAIL PROTECTED]> wrote: >> INSERT INTO phones (tel,id_customers) VALUES >> ('1234567',last_row_id()); > > Thanks, but I'm getting an error (FWIW, I'm using 3.5.4):

Re: [sqlite] INSERTing records in two tables?

2008-02-09 Thread Gilles
On Sat, 9 Feb 2008 08:41:56 -0500, "Igor Tandetnik" <[EMAIL PROTECTED]> wrote: >INSERT INTO phones (tel,id_customers) VALUES ('1234567',last_row_id()); Thanks, but I'm getting an error (FWIW, I'm using 3.5.4): sqlite> BEGIN;INSERT INTO customers (id,name) VALUES (NULL,'John Doe');INSERT

Re: [sqlite] INSERTing records in two tables?

2008-02-09 Thread Igor Tandetnik
"Gilles" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > = > BEGIN; > INSERT INTO customers (id,name) VALUES (NULL,'John Doe'); > ;How to get ROW_ID? > INSERT INTO phones (tel,id_customers) VALUES ('1234567',ROW_ID); > COMMIT; > = INSERT INTO phones (tel,id_customers) VALUES

[sqlite] INSERTing records in two tables?

2008-02-09 Thread Gilles
Hello I'm an SQL newbie, and would like to know how to perform the following INSERT's: = BEGIN; INSERT INTO customers (id,name) VALUES (NULL,'John Doe'); ;How to get ROW_ID? INSERT INTO phones (tel,id_customers) VALUES ('1234567',ROW_ID); COMMIT; = The two records are linked, since a