在你的cursor 中getgncls和getzlcs均被调用了两次
open p_CURSOR for
SELECT T_TYBM.TYBM, T_TYBM.DM, getgncls(tybm,pnf,8) AS ZCLS, getgncls(tybm,pnf,8) as YCTS ,
getgnjctsh(tybm,pnf,8) AS JCTS, getbnzsh(tybm,pnf,8) AS CCBNTS,
getzlcs(tybm,pnf,8) AS ZLBNTS, getzlcs(tybm,pnf,8) AS KDHLTS
FROM T_TYBM
WHERE substr(tybm,1,6) = temp_str
and substr(tybm,7,2)>'00'
and mod(to_number(tybm),100)=0
and T_TYBM.SHFYQ=1
order by tybm;
建议改为
open p_CURSOR for
SELECT TYBM, DM, ZCLS, ZCLS as YCTS ,
JCTS, CCBNTS, ZLBNTS, ZLBNTS AS KDHLTS
FROM
(
SELECT T_TYBM.TYBM, T_TYBM.DM, getgncls(tybm,pnf,8) AS ZCLS,
getgnjctsh(tybm,pnf,8) AS JCTS, getbnzsh(tybm,pnf,8) AS CCBNTS,
getzlcs(tybm,pnf,8) AS ZLBNTS
FROM T_TYBM
WHERE substr(tybm,1,6) = temp_str
and substr(tybm,7,2)>'00'
and mod(to_number(tybm),100)=0
and T_TYBM.SHFYQ=1
)
order by tybm;
open p_CURSOR for
SELECT T_TYBM.TYBM, T_TYBM.DM, getgncls(tybm,pnf,8) AS ZCLS, getgncls(tybm,pnf,8) as YCTS ,
getgnjctsh(tybm,pnf,8) AS JCTS, getbnzsh(tybm,pnf,8) AS CCBNTS,
getzlcs(tybm,pnf,8) AS ZLBNTS, getzlcs(tybm,pnf,8) AS KDHLTS
FROM T_TYBM
WHERE substr(tybm,1,6) = temp_str
and substr(tybm,7,2)>'00'
and mod(to_number(tybm),100)=0
and T_TYBM.SHFYQ=1
order by tybm;
建议改为
open p_CURSOR for
SELECT TYBM, DM, ZCLS, ZCLS as YCTS ,
JCTS, CCBNTS, ZLBNTS, ZLBNTS AS KDHLTS
FROM
(
SELECT T_TYBM.TYBM, T_TYBM.DM, getgncls(tybm,pnf,8) AS ZCLS,
getgnjctsh(tybm,pnf,8) AS JCTS, getbnzsh(tybm,pnf,8) AS CCBNTS,
getzlcs(tybm,pnf,8) AS ZLBNTS
FROM T_TYBM
WHERE substr(tybm,1,6) = temp_str
and substr(tybm,7,2)>'00'
and mod(to_number(tybm),100)=0
and T_TYBM.SHFYQ=1
)
order by tybm;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货