-- Tables

-- Alters

update AKUZ.T_ONK_CYTOLOGY_ROUTE_BASE cb
    set "examinationstate" = 0;

update AKUZ.T_ONK_CYTOLOGY_ROUTE_BASE cb
    set "examinationstate" = 2
from AKUZ.T_ONK_CYTOLOGY_RESULT_BASE mr 
where mr.OnkCytologyRoute = cb.AddParamsBaseID;

ALTER TABLE AKUZ.T_ONK_CYTOLOGY_ROUTE_BASE ALTER COLUMN "examinationstate" SET NOT NULL;