
如:
BEGIN
select a.c_reportcode, c.c_unitid
into cnb_vvarB, cnb_nvarF
from tb_org_unitrelation a, TB_CNB_NDJXINFO b,tb_inf_employee c
where b.c_empoid=c.c_oid
and a.c_orgunitid = c.c_unitid
and b.c_oid = to_number(cnb_vvarA)
EXCEPTION
WHEN NO_DATA_FOUND THEN
cnb_vvarB := 0
cnb_nvarF := 0
END
select count(*) into v_count from t_cxtwhere hpzl = v_cxdm
if v_count >0 then
count(hpzl) 如果hpzl列为NULL的时候,是不会计入最后的count值的.除非你确定此列不会有NULL出现,要么就用 count(*),只要有这条数据就会计数的. 另外你原来使用的nvl函数没必要,count函数不会返回NULL的.
这几行代码中不会出现ORA-01403: no data found的,检查别处的代码吧
select x.cph, y.cxdm into v_cph, v_cxdm
from t_cxt_users x left join t_cxt_cxdm y on x.cxdm = y.dxdm
where x.mobile = i_srcaddr
检查这句SQL, 如果查询不到记录,这样的赋值会出异常, 建议select .... into 前判断一下
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)