Exceptions

来源:互联网 发布:c语言编程面试题 编辑:程序博客网 时间:2024/06/10 06:28

System can raise two types of exceptions: with name or without name.

User raise named exception with Raise and unnamed exception with raise_application_error(#-20000 -- -20999)

User can use progma exception_init to associate an exception# with a name

User can declare named exceptions.

 

user can catch named exception with "when name then"

user can catch un-named exception with "when others then -- SQLCODE"

ex:

v_err_code := SQLCODE;

v_err_msg := SUBSTR(SQLERRM, 1, 200);

原创粉丝点击