Error: query has no destination for result data while using a cursor

后端 未结 2 1811
南笙
南笙 2020-12-11 23:21

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

相关标签:
2条回答
  • 2020-12-11 23:59

    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.

    0 讨论(0)
  • 2020-12-12 00:06

    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 the PERFORM statement:

    PERFORM query;
    
    0 讨论(0)
提交回复
热议问题