Category=Database Maintenance Name=09b. Migrate- Document Features Description=Grabs document data from current VMR tables and imports it to populate the Features table Heading=Import Document Data Into FEATURES OutputLevel=1 ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like 'l%+%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionContent', {0}, 'Gospels+Apostolos', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like 'l%e%' and CONTENTOVERVIEW not like 'l%k%' and CONTENTOVERVIEW not like 'l%sel%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionBookType', {0}, 'Weekdays', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like 'l%ek%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionBookType', {0}, 'Weekdays+Sun', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like 'l%sk%' and CONTENTOVERVIEW not like 'l%esk%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionBookType', {0}, 'Sat+Sun', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like 'l%sel%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionBookType', {0}, 'Selected', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like '%esk%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionBookType', {0}, 'Sat+Sun+Easter-Pent Weekdays', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where DOCUMENTID between 30000 and 49999 and CONTENTOVERVIEW like '%K%' and CONTENTOVERVIEW NOT LIKE '%:%' and CONTENTOVERVIEW NOT LIKE '%1K%' and CONTENTOVERVIEW NOT LIKE '%2K%' and CONTENTOVERVIEW NOT LIKE '%Kol%' and CONTENTOVERVIEW NOT LIKE '%Kath%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, USERINSTITUTIONID, USERID) VALUES ('Commentary', {0}, 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where DOCUMENTID IN (\ #20040,\ #20050,\ #20141,\ #30041,\ #30087,\ #30092,\ #30095,\ #30136,\ #30139,\ #30146,\ #30197,\ #30239,\ #30243,\ #30249,\ #30300,\ #30304,\ #30306,\ #30310,\ #30311,\ #30313,\ #30315,\ #30316,\ #30317,\ #30318,\ #30320,\ #30333,\ #30334,\ #30354,\ #30357,\ #30362,\ #30366,\ #30381,\ #30397,\ #30423,\ #30426,\ #30427,\ #30430,\ #30434,\ #30437,\ #30455,\ #30589,\ #30590,\ #30596,\ #30598,\ #30621,\ #30640,\ #30721,\ #30722,\ #30734,\ #30735,\ #30736,\ #30737,\ #30738,\ #30739,\ #30742,\ #30743,\ #30770,\ #30819,\ #30821,\ #30822,\ #30832,\ #30836,\ #30840,\ #30841,\ #30842,\ #30846,\ #30847,\ #30848,\ #30849,\ #30850,\ #30853,\ #30857,\ #30859,\ #30862,\ #30865,\ #30868,\ #30869,\ #30874,\ #30879,\ #30882,\ #30883,\ #30884,\ #30887,\ #30893,\ #30970,\ #30993,\ #30994,\ #31016,\ #31027,\ #31028,\ #31043,\ #31112,\ #31156,\ #31177,\ #31184,\ #31254,\ #31255,\ #31256,\ #31264,\ #31267,\ #31271,\ #31277,\ #31332,\ #31337,\ #31366,\ #31370,\ #31374,\ #31411,\ #31412,\ #31437,\ #31516,\ #31523,\ #31527,\ #31537,\ #31613,\ #31631,\ #31707,\ #31764,\ #31772,\ #31817,\ #31818,\ #31819,\ #31820,\ #31821,\ #31822,\ #31844,\ #31878,\ #31879,\ #31910,\ #31913,\ #31915,\ #31925,\ #31926,\ #31928,\ #31937,\ #31938,\ #31942,\ #31968,\ #31976,\ #31979,\ #31983,\ #31988,\ #31993,\ #32001,\ #32002,\ #32006,\ #32013,\ #32092,\ #32103,\ #32106,\ #32111,\ #32125,\ #32128,\ #32129,\ #32130,\ #32184,\ #32185,\ #32187,\ #32190,\ #32192,\ #32202,\ #32207,\ #32240,\ #32242,\ #32257,\ #32285,\ #32450,\ #32480,\ #32481,\ #32490,\ #32538,\ #32572,\ #32573,\ #32574,\ #32575,\ #32577,\ #32579,\ #32581,\ #32583,\ #32593,\ #32596,\ #32597,\ #32607,\ #32668,\ #32738,\ #32741,\ #32755,\ #32763,\ #32764,\ #32768,\ #32770,\ #32838,\ #32890)|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, USERINSTITUTIONID, USERID) VALUES ('Commentary', {0}, 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where DOCUMENTID between 30000 and 49999 and CONTENTOVERVIEW like '%P%' and CONTENTOVERVIEW NOT LIKE '%:%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('Extant', {0}, 'Partial', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like '%Jerus%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionTradition', {0}, 'Jerusalem', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like '%Lit%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionBookType', {0}, 'Other', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like '%PsO%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('LectionBookType', {0}, 'Psalms+Odes', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where DOCUMENTID between 20000 and 29999;|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('Script', {0}, 'Majuscule', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like '%INCOMPLETE%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('Extant', {0}, 'Incomplete', 49, 'ECM') #select distinct CONTENTOVERVIEW, CONCAT(LEFT(CONTENTOVERVIEW, INSTR(CONTENTOVERVIEW, '†')-1), RIGHT(CONTENTOVERVIEW, CHAR_LENGTH(CONTENTOVERVIEW)-INSTR(CONTENTOVERVIEW, '†'))) from DOCUMENT WHERE DOCUMENTID between 40000 and 49999 and CONTENTOVERVIEW like '%†%'; #ImportSQL=SELECT DOCUMENTID from DOCUMENT where CONTENTOVERVIEW like 'U-%' and DOCUMENTID between 40000 and 49999;|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('Script', {0}, 'Majuscule', 49, 'ECM') #ImportSQL=SELECT DOCUMENTID, right(CONTENTOVERVIEW, length(CONTENTOVERVIEW)-2) NC from DOCUMENT where CONTENTOVERVIEW like 'U-%' and DOCUMENTID between 40000 and 49999;|UPDATE DOCUMENT SET CONTENTOVERVIEW='{1}' WHERE DOCUMENTID={0} #ImportSQL=SELECT ObjID, (CASE WHEN Beschreibstoff ='Pap' THEN 'Paper' WHEN Beschreibstoff like'Pg%' THEN 'Parchment' WHEN Beschreibstoff ='PuPg' THEN 'Parchment' ELSE Beschreibstoff END) from vmrold.HSSListe where Beschreibstoff is not null and Beschreibstoff <> '' and Beschreibstoff <> '?'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('CanvasMaterial', {0}, '{1}', 49, 'ECM') #ImportSQL=SELECT ObjID, 'Paper' from vmrold.HSSListe where Beschreibstoff like 'Pg%Pap'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('CanvasMaterial', {0}, '{1}', 49, 'ECM') #ImportSQL=SELECT ObjID from vmrold.HSSListe where Beschreibstoff = 'PuPg'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, USERINSTITUTIONID, USERID) VALUES ('PurpleParchment', {0}, 49, 'ECM') #ImportSQL=SELECT ObjID, 'Gold' from vmrold.HSSListe where Beschreibstoff like '%Gold%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('WritingMaterial', {0}, '{1}', 49, 'ECM') #ImportSQL=SELECT ObjID, 'Silver' from vmrold.HSSListe where Beschreibstoff like '%Silber%'|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('WritingMaterial', {0}, '{1}', 49, 'ECM') #ImportSQL=SELECT ObjID, Soden from vmrold.HSSListe where Soden is not null|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('VonSoden', {0}, '{1}', 49, 'ECM') #ImportSQL=SELECT ObjID, Oxy from vmrold.HSSListe where Oxy is not null|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, USERINSTITUTIONID, USERID) VALUES ('Oxy', {0}, '{1}', 49, 'ECM') #ImportSQL=SELECT ObjID, LDAB, LDABurl from vmrold.HSSListe where LDAB<>0|INSERT INTO FEATURE (FEATURECODE, DOCUMENTID, STRINGVAL1, STRINGVAL2, USERINSTITUTIONID, USERID) VALUES ('LDAB', {0}, '{1}', '{2}', 49, 'ECM') IgnoreException=Error Code: 1146