I have to update 50 employees' id number. Id numbers are in sequence like
100001, 100002, 100003 ... 100050
I need to update them with another sequence series like
1004001, 1004002, 1004003 ... 1004050
So, I want to update using the loop. But I do not understand how to do this. I am using PL/SQL Developer with Oracle.
However, what I was trying is:
DECLARE
i number(1);
j number(1);
BEGIN
<< outer_loop >>
FOR i IN 100001..100051 LOOP
<< inner_loop >>
FOR j IN 1..3 LOOP
update employees e
set e.IDENTIFICATION_NUMBER = j
where e.IDENTIFICATION_NUMBER = i;
END loop inner_loop;
END loop outer_loop;
END;
/
update employee set IDENTIFICATION_NUMBER = IDENTIFICATION_NUMBER + 904000?