select concat('insert into PERSON(DOCUMENT_ID_NUMBER, TYPE_ID_DOCUMENT, SEX, MARITAL_STATUS, ACK_OPT_LOCK, USERNAME) values("', AUTHOR.ID_INTERNAL, '", "EXTERNAL", "MALE", "UNKNOWN", 1, "author', AUTHOR.ID_INTERNAL, '");') as "" from PUBLICATION_AUTHOR inner join AUTHOR on AUTHOR.ID_INTERNAL = PUBLICATION_AUTHOR.KEY_AUTHOR left join PERSON on PERSON.ID_INTERNAL = AUTHOR.KEY_PERSON where PERSON.ID_INTERNAL is null group by AUTHOR.ID_INTERNAL;
