DECLARE phone_no varchar2(100) := null; BEGIN FOR r1 IN (select user_name from tbl_user where phone is null) LOOP select phone into phone_no from tbl_profile where user_name = r1.user_name; update tbl_user set phone = phone_no where user_name = r1.user_name; END LOOP; END;