{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


07JulNote - dbms_output.put_line(num exception when others...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Exception Handling - Oracle define - User define --------------------------------------------- declare name emp.ename%type begin dbms_output.put_line('Name=' || name) exception when no_data_found then dbms_output.put_line('No Data Found.') when others then dbms_output.put_line('Undefine error.') end ------------------------------------- create sequence setest start with 1 increment by 1 maxvalue 10 ---------------------------------- declare num number begin select setest.nextval into num from dual
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dbms_output.put_line(num) exception when others then dbms_output.put_line('ERROR:' || sqlerrm) end-----------------------------------------declare num number myexcept exception begin select setest.currval into num from dual if num=10 then raise myexcept end if select setest.nextval into num from dual dbms_output.put_line(num) exception when myexcept dbms_output.put_line('ERROR: Maximum value') when others then dbms_output.put_line('ERROR:' || sqlerrm) end--------------------------------------------------...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online