因为有旧的数据手工填报在另外一个表,如何在oracle package 里判断执行取那段语句?比如oracle 包如图,当传进来是2025年,执行第一段代码,否则执行下面select 代码
create or replace package body fr_pkg_data_qin3 is procedure FR_finance_xjll_QIN3(p_nf number,p_data out fr_pkg_data_qin3.p_cursor) is begin open p_data for if p_nf=2025 then select tc_xjll04,tc_xjll01,sum(tc_xjll03)金额256 from tc_xjll_fr_qin where tc_xjll04=2024--p_nf group by tc_xjll04,tc_xjll01; else select tc_xjll04,tc_xjll01,sum(tc_xjll03)金额256 from tc_xjll_fr_qin where tc_xjll04=2025--p_nf group by tc_xjll04,tc_xjll01; end if; end; end fr_pkg_data_qin3; |
立即参与
