I am doing insert into one table record and generating UUID, how do I return this UUID to use in another part of my function?
function
do $$
begin
insert into table_1 values (uuid,,,,,,n);
-- need the result of this insert load into variable uuid_customer to reuse later
insert into tabel_2 (uuid,uuid_customer,,,,,,n );
end
in MSSQL I can use output, but what about Postgres
INSERT INTO table (name) OUTPUT Inserted.ID VALUES('bob');