declare
begin
for i in (select * from emp)
loop
if i.sal=1300 then
update emp
set sal=13000;
end if;
end loop;
end;
This code
This code is updating all the records with salary 13000. Instead i want to update records having salary 1300 to the value 13000.
for every record i am checking the sal value of that record.. if salary value in a particular record is 1500 i want to update it to 15000..
So what exactly do you want?
You want to update only 1,500 salary, you issue:
UPDATE emp
SET sal = 15000
WHERE sal = 1500;
You want to increase all salary ten times, you issue:
UPDATE emp
SET sal = sal * 10;