17,086
社区成员
发帖
与我相关
我的任务
分享
cursor c1(v_mcode varchar2, v_ifchk varchar2) is
select *
from a
where (a.mrlmcode = v_mcode or v_mcode is null) and
a.mrlrdate>=to_date(P_SDATE, 'yyyymmdd')
and a.mrlifchk = v_ifchk
order by a.mrlrdate;
view_mrl meterread_lkg%rowtype;
open c1(P_MICODE, P_ISCHK);
loop
fetch c1 into view_mrl;
select /*+and_equal(a,idx_mrlmcode,idx_mrlrdate,idx_mrlifchk)*/*
from a
where (a.mrlmcode = v_mcode or v_mcode is null) and
a.mrlrdate>=to_date(P_SDATE, 'yyyymmdd')
and a.mrlifchk = v_ifchk
order by a.mrlrdate;