ITeye博客

oracle中关于no_data_found异常的解决

xiajava2011 · 2011-09-05 18:01 · oracle数据库 · 数据库 · Markdown

在存储过程中,select name into v_name from table where 条件  的时候,如果没有查询到数据,
就不能将v_name进行赋值,就会抛出no_data_found异常,程序不能继续执行


解决:select count(*) into v_count from from table where 条件 ;
        if(v_count<>0) then
           select name into v_name from table where 条件;
        end if;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。