[code] declare cursor cur is select loc_id from location val loc_id.location%type; begin open cur; while cur%found loop fetch cur into val; update dept set dept_no=val where loc_id=val; end loop; close cur; end; / update emp set dept_no=val where loc_id=val; * ERROR at line 9: ORA-06550: line 9, column 32: PLS-00201: identifier 'loc_id' must be declared ORA-06550: line 9, column 3: PL/SQL: SQL Statement ignored [/code]