PL/SQL (MOSC)

MOSC Banner

Is Exception handler necessary for every stored subprogram

edited Nov 17, 2010 12:55AM in PL/SQL (MOSC) 9 commentsAnswered ✓
 Hi All,
I know exception handler is very important. But is it necessary for every stored procedure or function?

For example,

procedure test(p_index_code IN varchar2(10)
p_changed_code OUT varchar2(15))
as
begin
IF p_index_code = 'A' then
p_changed_code := 'A'|| p_index_code;
elsif p_index_code = 'B' then
p_changed_code := 'B'|| p_index_code;
else
p_changed_code := p_index_code;
end if;
end;

This kind of simple procedures, do I have to add the 'exection when others than raise_application_error(-20001,'error in this SP')'?
I can't see obvious drawbacks without the exception handler

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center