I\'m trying to insert a row into a PostgreSQL table with a serial primary key and I need to retrieve this column after it was inserted. I got something like this:
Th
insert into pais(nombre, capital) values(@nombre, @capital) RETURNING id
replace id with your primary keyenter code here and use
id
enter code here
Object res = query.ExecuteScalar();
Inside res you'll have the PK.
res