Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

user defined exception in procedure

848949Jul 26 2011 — edited Jul 26 2011
while exceuting this procedure m getting error even when i handled with exception.

set serveroutput on
create or replace procedure ad(id number,name varchar,did number)
is
fk_constraint exception;

begin
insert into es values(id,'name',did);
if SQL%NOTFOUND then
raise fk_constraint;
end if;
rollback;
exception
when fk_constraint then
dbms_output.put_line('INVALID DEPT');
end;

/
execute ad(1500,'avc',11);

can anyone help me to resolve this.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2011
Added on Jul 26 2011
12 comments
548 views