PL/SQL (MOSC)

MOSC Banner

ORACLE EXCEPTION

edited Aug 20, 2013 5:55AM in PL/SQL (MOSC) 3 commentsAnswered

I was writing a function today to return a specific value based on a where condition. I did have a exception block to caption any unwanted exception and return a value. But i was surprised to see that after Too many rows was raised it was still able to return a value. 

Below is a test code that can be used to replicate

create table test_too_many_rows
(
val number
);
insert into test_too_many_rows values(1);
insert into test_too_many_rows values(2);
create or replace function get_too_many_values
return number
is
    numVal  number:=-999;
begin

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