select concat('update PERSON set PERSON.KEY_EXTERNAL_PERSON = ',
	EXTERNAL_PERSON.ID_INTERNAL, 
	' where PERSON.ID_INTERNAL = ', 
	EXTERNAL_PERSON.KEY_PERSON, ';') 
as "" from EXTERNAL_PERSON where EXTERNAL_PERSON.KEY_PERSON IS NOT NULL;