I have a function which I have written to automate the execution of a group of functions for my project. I am taking a refcursor where I am storing my required data which I
I got the problem with my query. I was able to solve my problem. In the function where I am using SELECT while calling the function, I just replaced the keyword SELECT with the keyword with PERFORM.
I changed it and made it something like this:
PERFORM ccdb.o_dtr_update(sec_code.section_code);
PERFORM ccdb.o_consumer_update_for_update(sec_code.section_code);
PERFORM ccdb.o_bills_update_for_update(sec_code.section_code);
PERFORM ccdb.o_payments_update_for_update_new(sec_code.section_code);
PERFORM ccdb.o_payments_map_update_for_update(sec_code.section_code);
After making this change my function worked perfectly.
Thanks.
As per instructions in the manual:
Sometimes it is useful to evaluate an expression or
SELECT
query but discard the result, for example when calling a function that has side-effects but no useful result value. To do this in PL/pgSQL, use thePERFORM
statement:PERFORM query;