Updating a record using cursor
This tutorial requires you to access the environment using Remote Desktop, and that you be provisioned as an administrator on the instance.The Fleet Management application provides a rental car company a system for managing vehicles, customers and vehicle reservations.
clause; columns not explicitly modified retain their previous values.
If it does, then only one of the join rows will be used to update the target row, but which one will be used is not readily predictable.
Because of this indeterminacy, referencing other tables only within sub-selects is safer, though often harder to read and slower than using a join.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
Thanks,reacha Sorry this was the error that i am getting ORA-06550: line 2, column 29: PL/SQL: ORA-00904: "RETENTION_ID": invalid identifier ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 11, column 18: PL/SQL: ORA-00904: "B"."RETENTION_ID": invalid identifier ORA-06550: line 9, column 1: in the update statement inside the for loop can't find the table b (alias)the update statement should read like this UPDATE en.agt_name a SET a.emp_num = i.emp_numwhere a.userid = i.retention_id; Ensure retention_id column is exist on the table, as per your DESC result retention_id is does not exist. In your code, you must refer to tarner.nexros by the name you declared for the cursor in your for loop, "i".