I have trouble updating my table. My script works, but in the end, my table is not updated.
DECLARE
RCT_ID VARCHAR(6);
CURSOR CUR IS
SELECT T.PRM FROM TABLE_NAME T;
BEGIN
FOR MY_CUR IN CUR LOOP
SELECT ID
INTO RCT_ID
FROM njn_refcpt r
WHERE r.num_pce_pdl = my_cur.prm;
dbms_output.put_line('RCT_ID: ' || RCT_ID);
dbms_output.put_line('my_cur.prm: ' || my_cur.prm);
UPDATE TABLE_NAME t SET T.RCT_ID = RCT_ID WHERE t.prm = my_cur.prm;
COMMIT;
END LOOP;
END;
The output displays values for RCT_ID and my_cur.prm. So why doesn't the update work?
Thanks.