Category=coptot - Database Maintenance
Name=11.1. Update SMR Leaves Description features
Description=Grabs leaves description data from INTF SMR and updates the data model

#OutputLevel=3

Heading=Update LeavesDescription features from SMR table data

ImportSQL=select * from (select (case when smr like '%sa%' then 620000 when smr like '%bo%' then 600000 when smr like '%fa%' then 631000 when smr like '%mae%' then 632000 when smr like '%ac%' then 633000 when smr like '%cv%' then 634000 when smr like '%cw%' then 635000 when smr like '%ly%' then 636000 end) + cast(substring_index(substring_index(substring_index(substring_index(smr,' ',-1), 'L', 1), 'v', 1),'}',1) as unsigned) as DOCUMENTID, replace(replace(smr, '\\{', ''), '}', '') GANUMBER, Blattzahl LEAVESDESCRIPTION, Zzorg LINECOUNTDESCRIPTION, Blattgroesse HEIGHTDESCRIPTION, Blattgroesse2 WIDTHDESCRIPTION from smr.synopsis_manuscript) t where LEAVESDESCRIPTION is not null and not exists (select 1 from FEATURE f where f.DOCUMENTID=t.DOCUMENTID and FEATURECODE='LeavesDescription' and STRINGVAL2='SMR' and STRINGVAL1=t.LEAVESDESCRIPTION and USERID='judge') order by DOCUMENTID;|UPDATE FEATURE set STRINGVAL1='{2}' where DOCUMENTID={0} and FEATURECODE='LeavesDescription' and STRINGVAL2='SMR' and USERID='judge';

