select concat('insert into ACADEMIC_CALENDAR_ENTRY (TITLE, OJB_CONCRETE_CLASS, KEY_ROOT_DOMAIN_OBJECT, BEGIN, END, REFERENCE_KEY, KEY_PARENT_ENTRY) values ("' , concat('pt',length(EXECUTION_PERIOD.NAME),':',EXECUTION_PERIOD.NAME) , '","net.sourceforge.fenixedu.domain.time.calendarStructure.AcademicSemesterCE",1,"' , concat(EXECUTION_PERIOD.BEGIN_DATE_YEAR_MONTH_DAY,' 00:00:00') , '","' , concat(EXECUTION_PERIOD.END_DATE_YEAR_MONTH_DAY,' 00:00:00') , '",' , EXECUTION_PERIOD.ID_INTERNAL , ',' , ACADEMIC_CALENDAR_ENTRY.ID_INTERNAL ,');') as "" from EXECUTION_PERIOD inner join ACADEMIC_CALENDAR_ENTRY on ACADEMIC_CALENDAR_ENTRY.REFERENCE_KEY = EXECUTION_PERIOD.KEY_EXECUTION_YEAR;
