[INSERT]Return a value
| От | Leví Teodoro da Silva | 
|---|---|
| Тема | [INSERT]Return a value | 
| Дата | |
| Msg-id | 4a74ba520811070521v33680720x1ed4b061ff4eb2b8@mail.gmail.com обсуждение исходный текст | 
| Ответы | Re: [INSERT]Return a value Re: [INSERT]Return a value | 
| Список | 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í
		
	
	
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 по дате отправления: