O
O
ortsuev332018-11-06 14:25:24
SQL
ortsuev33, 2018-11-06 14:25:24

How to get the id of the inserted record?

How to get the id of the inserted record, not the last one, taking into account multithreading.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dollar, 2018-11-06
@ortsuev33

The INSERT command returns the id of the new entry.
What exactly is the problem?

A
Alexander, 2018-11-06
@NeiroNx

PostgreSQL has RETURNING

INSERT INTO ulica (nameulicadop,guid) VALUES
('1 ул','f2ddb1ab-5f51-429a-8a99-84cc9bc124af')
 RETURNING id,guid;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question