PL/SQL userdefined Exception
declare
cid number;
cname varchar2(20);
cdes varchar2(20);
csal number;
notZero exception;
begin
cid:=&number;
if(cid<=0)
then
raise notZero;
end if;
cname:='&cname';
cdes:='&cdes';
csal:=&csal;
insert into employee values(cid,cname,cdes,csal);
exception
when notZero then
dbms_output.put_line('id cant be zero');
when others then
dbms_output.put_line('Check the code again');
end;
/
Comments
Post a Comment