PB scrip中,在cursor中執行PROCEDURE,可以執行,但是得不到任何結果值,把cursor關掉,直接執行PROCEDURE就能正常,有人知道為什麼嗎?

问题遇到的现象和发生背景

PB scrip中,在cursor中執行PROCEDURE,可以執行,但是得不到任何結果值,
把cursor關掉,直接執行PROCEDURE就能正常,有人知道為什麼嗎?

用代码块功能插入代码,请勿粘贴截图

declare sto_curs cursor for
select sto02, sto03 from sto;

open sto_curs  ;

fetch sto_curs into :ls_sto02, :ls_sto03 ;
DO WHILE sqlca.sqlcode = 0
        
    DECLARE stor01 PROCEDURE FOR usp_stor01  :ls_sto02, :ls_sto03;
    EXECUTE stor01 ;
        
    FETCH sto_curs into :ls_sto02, :ls_sto03 ;
loop
close sto_curs ;