select p.prs_perslid_nr, prs_perslid_oslogin, i.* from tmp_imp_perslid i, prs_perslid p
where naam <> 'Naam'
and to_number(oud) = to_number(prs_perslid_nr)
and nummer is not null
and userid = prs_perslid_oslogin


/* Formatted on 6/13/2013 10:00:56 AM (QP5 v5.136.908.31019) */
SELECT *
  FROM tmp_imp_perslid
 WHERE NOT EXISTS
          (SELECT prs_perslid_nr
             FROM prs_perslid p
            WHERE naam <> 'Naam'
              AND fac.safe_TO_NUMBER (oud) = fac.safe_TO_NUMBER (prs_perslid_nr)
              )
              and nummer is null
              
              
/* Formatted on 6/13/2013 9:49:10 AM (QP5 v5.136.908.31019) */
/* Formatted on 6/13/2013 9:52:29 AM (QP5 v5.136.908.31019) */
UPDATE prs_perslid p
   SET prs_perslid_nr =
          (SELECT i.nummer
             FROM tmp_imp_perslid i
            WHERE naam <> 'Naam'
              AND nummer IS NOT NULL
              AND userid = prs_perslid_oslogin)
 WHERE EXISTS
          (SELECT i.nummer
             FROM tmp_imp_perslid i
            WHERE naam <> 'Naam'
              AND nummer IS NOT NULL
              AND userid = prs_perslid_oslogin)