create or replace procedure lee_update_sala
as
cursor c_row
is
select * from lee_emp_0714 for update of sala;
begin
for v_row in c_row loop
--if(v_row.sala=12459) then update lee_emp_0714 set sala=sala-1000 where current of c_row;
if(v_row.indate<to_date('2005-1-1','yyyy-mm-dd')) then update lee_emp_0714 set sala=sala+2000 where current of c_row;
elsif (v_row.indate>to_date('2005-1-1','yyyy-mm-dd')) and v_row.indate<to_date('2006-1-1','yyyy-mm-dd') then
update lee_emp_0714 set sala=sala+1000;
else update lee_emp_0714 set sala=sala+500 where current of c_row;
end if;
end loop;
end;