--benthos lengte update pruts.t0benthos set value = lengte where lengte is not null; update pruts.t0benthos set value = null where lengte is null; update pruts.t0benthos set idmethod = 0 where lengte is not null; update pruts.t0benthos set idobservation_type = 33 where soortnaam is not null; update pruts.t0benthos set idunit = 7 where lengte is not null; update pruts.t0benthos set quality = 1 where lengte is not null; insert into observation (idmethod,idunit,date,value,idlocation,idparameter,idobservation_type,idsample,idquality,remark) select i.idmethod ,i.idunit ,i.date ,i.value ,i.idlocation ,i.idparameter ,i.idobservation_type ,i.locid ,i.quality ,i.kwaliteit_determinatie FROM pruts.t0benthos i where lengte is not null; --benthos aantal update pruts.t0benthos set value = aantal where soortnaam is not null; update pruts.t0benthos set value = 0 where idparameter = 42543; update pruts.t0benthos set value = null where aantal = null; update pruts.t0benthos set idmethod = 49 where soortnaam is not null; update pruts.t0benthos set idobservation_type = 16 where soortnaam is not null; update pruts.t0benthos set idunit = 18 where soortnaam is not null; update pruts.t0benthos p set quality = l.idquality from quality l where LTRIM(RTRIM(p.kwaliteit_tellen)) like l.qualitydescription; insert into observation (idmethod,idunit,date,value,idlocation,idparameter,idobservation_type,idsample,idquality,remark) select i.idmethod ,i.idunit ,i.date ,i.value ,i.idlocation ,i.idparameter ,i.idobservation_type ,i.locid ,i.quality ,i.kwaliteit_determinatie FROM pruts.t0benthos i where aantal is not null and value is not null; --benthos Natgewicht update pruts.t0benthos set value = natgewicht_mg where soortnaam is not null; update pruts.t0benthos set value = 0 where idparameter = 42543; update pruts.t0benthos set value = null where natgewicht_mg = null; update pruts.t0benthos set idobservation_type = 4 where soortnaam is not null; update pruts.t0benthos set idunit = 33 where soortnaam is not null; update pruts.t0benthos p set quality = l.idquality from quality l where LTRIM(RTRIM(p.kwaliteit_natgewicht)) like l.qualitydescription; update pruts.t0benthos set idmethod = 0 where quality is null; update pruts.t0benthos set idmethod = 0 where kwaliteit_natgewicht = 'Niet beschikbaar%'; update pruts.t0benthos set idmethod = 34 where quality = 13; update pruts.t0benthos set idmethod = 43 where quality = 14; update pruts.t0benthos set idmethod = 32 where quality = 18; insert into observation (idmethod,idunit,date,value,idlocation,idparameter,idobservation_type,idsample,idquality,remark) select i.idmethod ,i.idunit ,i.date ,i.value ,i.idlocation ,i.idparameter ,i.idobservation_type ,i.locid ,i.quality ,i.kwaliteit_determinatie FROM pruts.t0benthos i where natgewicht_mg is not null and value is not null; --benthos Asvrij drooggewicht update pruts.t0benthos set value = asvrdrooggewicht_mg where soortnaam is not null; update pruts.t0benthos set value = 0 where idparameter = 42543; update pruts.t0benthos set value = null where asvrdrooggewicht_mg = null; update pruts.t0benthos set idobservation_type = 5 where soortnaam is not null; update pruts.t0benthos set idunit = 33 where soortnaam is not null; update pruts.t0benthos p set quality = l.idquality from quality l where LTRIM(RTRIM(p.kwal_asvrijdrooggew)) like l.qualitydescription; update pruts.t0benthos set idmethod = 0 where quality is null; update pruts.t0benthos set idmethod = 0 where kwaliteit_natgewicht = 'Niet beschikbaar%'; update pruts.t0benthos set idmethod = 33 where quality = 16; update pruts.t0benthos set idmethod = 31 where quality = 17; update pruts.t0benthos set idmethod = 32 where quality = 18; update pruts.t0benthos set idmethod = 30 where quality = 19; insert into observation (idmethod,idunit,date,value,idlocation,idparameter,idobservation_type,idsample,idquality,remark) select i.idmethod ,i.idunit ,i.date ,i.value ,i.idlocation ,i.idparameter ,i.idobservation_type ,i.locid ,i.quality ,i.kwaliteit_determinatie FROM pruts.t0benthos i where asvrdrooggewicht_mg is not null and value is not null; --benthos Dichtheid update pruts.t0benthos set value = dichtheid where dichtheid is not null; update pruts.t0benthos set value = null where dichtheid is null; update pruts.t0benthos set idmethod = 43 where dichtheid is not null; update pruts.t0benthos set idobservation_type = 3 where dichtheid is not null; update pruts.t0benthos set idunit = 4 where dichtheid is not null; update pruts.t0benthos set quality = 1 where dichtheid is not null; insert into observation (idmethod,idunit,date,value,idlocation,idparameter,idobservation_type,idsample,idquality,remark) select i.idmethod ,i.idunit ,i.date ,i.value ,i.idlocation ,i.idparameter ,i.idobservation_type ,i.locid ,i.quality ,i.kwaliteit_determinatie FROM pruts.t0benthos i where dichtheid is not null and value is not null; --benthos Massa update pruts.t0benthos set value = massa_mg_m2 where massa_mg_m2 is not null; update pruts.t0benthos set value = null where massa_mg_m2 is null; update pruts.t0benthos set idmethod = 0 where massa_mg_m2 is not null; update pruts.t0benthos set idobservation_type = 13 where massa_mg_m2 is not null; update pruts.t0benthos set idunit = 6 where massa_mg_m2 is not null; update pruts.t0benthos set quality = 1 where massa_mg_m2 is not null; insert into observation (idmethod,idunit,date,value,idlocation,idparameter,idobservation_type,idsample,idquality,remark) select i.idmethod ,i.idunit ,i.date ,i.value ,i.idlocation ,i.idparameter ,i.idobservation_type ,i.locid ,i.quality ,i.kwaliteit_determinatie FROM pruts.t0benthos i where massa_mg_m2 is not null and value is not null; --benthos Biomassa update pruts.t0benthos set value = biomassa_mg_m2 where biomassa_mg_m2 is not null; update pruts.t0benthos set value = null where biomassa_mg_m2 is null; update pruts.t0benthos set idmethod = 0 where biomassa_mg_m2 is not null; update pruts.t0benthos set idobservation_type = 34 where biomassa_mg_m2 is not null; update pruts.t0benthos set idunit = 6 where biomassa_mg_m2 is not null; update pruts.t0benthos set quality = 1 where biomassa_mg_m2 is not null; insert into observation (idmethod,idunit,date,value,idlocation,idparameter,idobservation_type,idsample,idquality,remark) select i.idmethod ,i.idunit ,i.date ,i.value ,i.idlocation ,i.idparameter ,i.idobservation_type ,i.locid ,i.quality ,i.kwaliteit_determinatie FROM pruts.t0benthos i where biomassa_mg_m2 is not null and value is not null;