Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to define a user defined exception in PLSQL?

user-image
Question added by Nidhi Goel , IOT Lead : Smart Meters , DEWA
Date Posted: 2017/09/05
Shahid Yousaf
by Shahid Yousaf , Oracle Development Engineer , MERCATOR LLC FZE

DECLARE <declarations section> BEGIN <executable command(s)> EXCEPTION <exception handling goes here > WHEN exception1 THEN exception1-handling-statements WHEN exception2 THEN exception2-handling-statements WHEN exception3 THEN exception3-handling-statements ........ WHEN others THEN exception3-handling-statements END;

You can simply call RAISE EXCEPTION in transaction. 

RAISE EXCEPTION 'Nonexistent ID --> %', user_id USING HINT = 'Please check your user ID';

More Questions Like This