SELECT CONCAT('update CANDIDACY_SITUATION set KEY_PERSON =',E.KEY_PERSON,' WHERE KEY_EMPLOYEE=',E.ID_INTERNAL,';') as "" 
from CANDIDACY_SITUATION C,ass_FUNCIONARIO E 
WHERE C.KEY_EMPLOYEE = E.ID_INTERNAL;


SELECT CONCAT('update CANDIDACY_SITUATION set KEY_PERSON =',C.KEY_PERSON,' WHERE ID_INTERNAL=',CS.ID_INTERNAL,';') as "" 
from CANDIDACY_SITUATION CS,CANDIDACY C
WHERE CS.KEY_CANDIDACY = C.ID_INTERNAL AND CS.KEY_EMPLOYEE IS NULL;


