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
You need to put a constraint on your update statement.
What you have at the moment will loop through the results rows, and if it finds a row with salary equal to 1300, if then executest he following SQL:
update emp set sal=13000;
Without the contraint this updates every row.