[INSERT]Return a value - Mailing list pgsql-novice

From Leví Teodoro da Silva
Subject [INSERT]Return a value
Date
Msg-id 4a74ba520811070521v33680720x1ed4b061ff4eb2b8@mail.gmail.com
Whole thread Raw
Responses Re: [INSERT]Return a value
Re: [INSERT]Return a value
List 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í

pgsql-novice by date:

Previous
From: "Leví Teodoro da Silva"
Date:
Subject: Re: [DUMP] Make a dump with special characters
Next
From: "A. Kretschmer"
Date:
Subject: Re: [INSERT]Return a value