ALTER TABLE PROCESS ADD COLUMN PROCESS_CODE varchar(30) UNIQUE;
UPDATE PROCESS PROC, PROCESS PAREN, CANDIDACY_PERIOD CP, EXECUTION_INTERVAL EI SET PROC.PROCESS_CODE = CONCAT(SUBSTRING(BEGIN_DATE_YEAR_MONTH_DAY, 3, 2), SUBSTRING(END_DATE_YEAR_MONTH_DAY, 3, 2), PROC.ID_INTERNAL) WHERE PROC.KEY_CANDIDACY_PROCESS = PAREN.ID_INTERNAL AND PAREN.KEY_CANDIDACY_PERIOD = CP.ID_INTERNAL AND CP.KEY_EXECUTION_INTERVAL = EI.ID_INTERNAL;
