Pages

To update the sal with exception

declare
vempno number(4);
vename varchar2(20);
vsal number;
begin
select empno,ename, sal into vempno,vename, vsal from emp
where empno=&empno;
if vsal<1000 then
update emp set sal=sal+sal*0.35
where empno=vempno;
end if;
dbms_output.put_line('the emp det are:'||vename||''||vsal);
exception
when no_data_found then
dbms_output.put_line('the empno is not exists');
end;

No comments:

Post a Comment

Thanks