I have a PREPARE statement which is being called multiple times using EXECUTE. To save database connection cost, we make a big query like:
PREPARE updreturn as update myTable set col1 = 1 where col2= $1 returning col3;
EXECUTE updreturn(1);
EXECUTE updreturn(2);
....
EXECUTE updreturn(10);
and send to the database. However, I get the result for only the last EXECUTE statement.
Is there a way I could store these results in a temporary table and get all the results?