标签: sql exception nvl
我遇到以下代码的问题。当select语句返回null时。它引发了没有找到数据异常。但是根据我的知识,如果它返回null,它应该返回0。这里的 sample_id 和 c_task_value 都具有相同的长度,相同的变量类型(数字(8))。 n 是光标的对象
select NVL(sample_id,0) into c_task_value from SAMPLE_TABLE where abc= n.abc and cde= n.cde and efg= n.efg;