[INSERT]Return a value

From: Leví Teodoro da Silva <tlevisilva(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: [INSERT]Return a value
Date: 2008-11-07 13:21:05
Message-ID: 4a74ba520811070521v33680720x1ed4b061ff4eb2b8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi guys,

I was looking for something like the follow but i dont get ...

I want to do two inserts. In my first insert i want that the query returns a
result for me and in the second, i want that the postgres just insert the
values in my table.

I thought the following :

BEGIN;
INSERT INTO "Login"(
"CPF", "password", status, "idSeller")
VALUES ('108', '12345', 'ok', '2555') RETURNING "CPF" INTO STRICT teste;

INSERT INTO "Login"(
"CPF", "password", status, "idSeller")
VALUES ('109', '12345', 'ok', '2559');
COMMIT;

It's execute the inserts but i dont receive the CPF value. If i put the
first insert in a simple query, without BEGIN and COMMIT, it works fine.

How can i solve this problem !?

Regards,
Thanks,
Leví

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message A. Kretschmer 2008-11-07 13:34:38 Re: [INSERT]Return a value
Previous Message Leví Teodoro da Silva 2008-11-07 12:07:45 Re: [DUMP] Make a dump with special characters