declare
eno
number(4);
ename
Staff.Name%type;
sal
Staff.Basic_Salary%type;
lessthan
exception;
begin
eno:=&eno;
select
Basic_Salary into sal from Staff where Empno=eno;
if
sal>58000 then
raise
lessthan;
else
sal:=sal+3000;
select Name
into ename from Staff where Empno=eno;
insert into
UpStaff values(eno, ename, sal);
end if;
exception
when lessthan then
dbms_output.put_line('Salary greater than
58000');
when
no_data_found then
dbms_output.put_line('Empno not found');
end;
No comments:
Post a Comment