-- 转化 获得学年度 value select count(*) into qzsz_count from up_codelist c where c.codekind = 'SIS_DM_XNDM' and c.codename = v_xnd; IF qzsz_count > 0 THEN select c.codevalue into v_xnd_val from up_codelist c where c.codekind = 'SIS_DM_XNDM' and c.codename = v_xnd; ELSE v_xnd_val:=''; END IF;
select nvl(c.codevalue, 0) into v_xnd_val from up_codelist c where c.codekind = 'SIS_DM_XNDM' and c.codename = v_xnd;
just try try
我写两句话就是因为这问题,你可以试试,当up_codelist表是个空表,你的语句一定报错!想想其他方法?