存储过程 raise什么意思EXCEPTION when others then rollback; dbms_output.put_line('code:' || sqlcode); dbms_output.put_line('errm:' || sqlerrm); raise;when others then和raise;分别是什么意思

来源:学生作业帮助网 编辑:六六作业网 时间:2024/07/14 06:12:03
存储过程raise什么意思EXCEPTIONwhenothersthenrollback;dbms_output.put_line(''code:''||sqlcode);dbms_output.put_

存储过程 raise什么意思EXCEPTION when others then rollback; dbms_output.put_line('code:' || sqlcode); dbms_output.put_line('errm:' || sqlerrm); raise;when others then和raise;分别是什么意思
存储过程 raise什么意思
EXCEPTION
when others then
rollback;
dbms_output.put_line('code:' || sqlcode);
dbms_output.put_line('errm:' || sqlerrm);
raise;
when others then和raise;
分别是什么意思

存储过程 raise什么意思EXCEPTION when others then rollback; dbms_output.put_line('code:' || sqlcode); dbms_output.put_line('errm:' || sqlerrm); raise;when others then和raise;分别是什么意思
异常分很多种类,如NO_FOUND.others处本应该写异常名称,如果不想把异常分得那麼细,可以笼统一点用others来捕获,即所有异常均用others来捕获.
when others then表示是其它异常.
raise表示抛出异常,让User可以看到.