select * from aaes_imp_soap_perslid i, prs_perslid p where prs_perslid_authenticatie = i.id
and i.personeelsnummer = p.prs_perslid_nr

select * from prs_perslid

   SELECT prs_perslid_authenticatie,
          prs_perslid_oslogin,
          DECODE (UPPER(SUBSTR(prs_perslid_email, INSTR(prs_perslid_email, '@'))), 
                  '@AA-FM.COM', (SELECT email FROM aaes_imp_soap_perslid WHERE id = prs_perslid_authenticatie), 
                  prs_perslid_email),
          prs_perslid_voornaam,
          prs_perslid_voorletters,
          prs_perslid_tussenvoegsel,
          prs_perslid_naam,
          prs_perslid_nr,
          DECODE (
             sp.prs_srtperslid_key,
             1,
             NULL,
             (DECODE ( (SELECT UPPER (functie)
                          FROM aaes_imp_soap_perslid
                         WHERE id = prs_perslid_authenticatie),
                      UPPER (prs_srtperslid_omschrijving),
                      (SELECT functie
                         FROM aaes_imp_soap_perslid
                        WHERE id = prs_perslid_authenticatie),
                      prs_srtperslid_omschrijving)))
             prs_srtperslid_omschrijving,
          DECODE (UPPER(SUBSTR(prs_perslid_email, INSTR(prs_perslid_email, '@'))), 
                  '@AA-FM.COM', (SELECT organisatieid FROM aaes_imp_soap_perslid WHERE id = prs_perslid_authenticatie), 
                  prs_kenmerklink_waarde),
          prs_perslid_mobiel,
          prs_perslid_telefoonnr,
          1
     FROM prs_perslid p,
          prs_afdeling a,
          prs_srtperslid sp,
          (SELECT prs_kenmerklink_waarde, 
                  prs_link_key prs_afdeling_key 
             FROM prs_kenmerklink kl
            WHERE kl.prs_kenmerk_key = 1040) kl
    WHERE     p.prs_afdeling_key = a.prs_afdeling_key
          AND p.prs_srtperslid_key = sp.prs_srtperslid_key
          AND a.prs_afdeling_key = kl.prs_afdeling_key(+)
          AND prs_perslid_nr IS NOT NULL
          AND prs_perslid_verwijder IS NULL
          AND prs_perslid_authenticatie IS NOT NULL;
          
          
          select * from aaes_imp_soap_perslid
          
          select * from fac_soapdata
          
          select * from imp_log
          
          select * from prs_perslid where prs_perslid_apikey is not null
          
          update prs_perslid set prs_perslid_apikey = prs_perslid_authenticatie where prs_perslid_authenticatie like 'IAM%'
          
          update prs_perslid set prs_perslid_authenticatie = null where prs_perslid_authenticatie like 'IAM%'
          
          select * from prs_perslid
          
          select * from prs_afdeling where prs_afdeling_key = 641
          
          insert into fac_soapdata (fac_soapdata_seq, fac_soapdata_name, fac_soapdata_value)
          values (2, 'Id', 'IAM-15689214');
          
          insert into fac_soapdata (fac_soapdata_seq, fac_soapdata_name, fac_soapdata_value)
          values (2, 'personeelsnummer', '00506101');
          
          begin AAES.SOAP_ACTION('INSERT', 2, 'USER'); end;
          
          select * from prs_perslid where prs_perslid_nr = '00506101'
          
          select * from aaes_imp_soap_perslid
          
          delete aaes_imp_soap_perslid