User Defined Exception Example 2 SQL
In this example I will be showing how to define your own exception.
DECLARE e_president EXCEPTION; BEGIN FOR rec IN (SELECT * FROM emp WHERE job = 'PRESIDENT') LOOP IF (rec.deptno != 120) THEN RAISE e_president; END IF; END LOOP; EXCEPTION WHEN e_president THEN DBMS_OUTPUT.PUT_LINE('President is not working in correct dept'); END; /
Total Views: 750
My name is Jean-Mathieu
I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.
|jean8mathieu||Created on 02/25/15|
Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.