[INSERT]Return a value

Поиск
Список
Период
Сортировка
От Leví Teodoro da Silva
Тема [INSERT]Return a value
Дата
Msg-id 4a74ba520811070521v33680720x1ed4b061ff4eb2b8@mail.gmail.com
обсуждение исходный текст
Ответы Re: [INSERT]Return a value  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: [INSERT]Return a value  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Leví Teodoro da Silva"
Дата:
Сообщение: Re: [DUMP] Make a dump with special characters
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: [INSERT]Return a value