SELECT 
CONCAT('INSERT INTO PARTY_CONTACT (KEY_ROOT_DOMAIN_OBJECT, OJB_CONCRETE_CLASS, VISIBLE, DEFAULT_CONTACT, TYPE, KEY_PARTY, URL) VALUES (1, "net.sourceforge.fenixedu.domain.contacts.WebAddress", 1, 1, "PERSONAL", ', PARTY.ID_INTERNAL, ', "', REPLACE(TRIM(PARTY.WEB_ADDRESS), '\\', '/'), '");') AS ""
FROM PARTY WHERE PARTY.WEB_ADDRESS IS NOT NULL AND INSTR(PARTY.WEB_ADDRESS, '.') > 0 AND PARTY.WEB_ADDRESS REGEXP '[^-.]+' = 1 AND INSTR(PARTY.WEB_ADDRESS, '@') = 0;
