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
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):
>
>
"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):
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
"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
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
6 matches
Mail list logo