{"id":18,"date":"2007-06-11T22:27:29","date_gmt":"2007-06-11T22:27:29","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=18"},"modified":"2023-01-16T08:16:54","modified_gmt":"2023-01-16T08:16:54","slug":"attribute-level-imports","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/attribute-level-imports","title":{"rendered":"Attribute-Level Imports"},"content":{"rendered":"<p><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">MIIS gives you the option of specifying individual attributes to include in your delta import. Presumably you could use this to specify which single-valued attribute to import (perhaps the Surname has changed, but nothing else has), but I&#8217;d be surprised if you got much of a performance improvement compared to just re-importing the whole row. <\/span><\/span><\/p>\n<p><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">Where attribute-level imports can really make a difference, however, is when you&#8217;re importing multivalue attributes, allowing you to direct MIIS to the appropriate lines in the Values table, while ignoring the rest.<\/span><\/span><\/p>\n<p><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">In addition to &#8220;Add&#8221;, &#8220;Delete&#8221; and &#8220;Modify&#8221; we use an extra keyword in the ChangeType column to indicate an attribute-level import. I use &#8220;Att_Modify&#8221;, but you can use another word if you prefer.<\/span><\/span><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">\u00a0<\/span><\/span><span lang=\"EN-GB\"><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">First modify your Delta table, to add an extra column called &#8220;AttributeName&#8221;. This column will hold the name of the attribute to be imported. It will only be referred to if the ChangeType column contains &#8220;Att_Modify&#8221;.<\/span><\/span><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">\u00a0<\/span><\/span><\/span><\/p>\n<table class=\"MsoTableGrid\" style=\"border-collapse: collapse;\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"width: 88.55pt; background-color: transparent; border: windowtext 1pt solid; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><strong><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">ObjectID<\/span><\/span><\/span><\/strong><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><strong><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">ObjectType<\/span><\/span><\/span><\/strong><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><strong><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">ChangeType<\/span><\/span><\/span><\/strong><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><strong><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">AttributeName<\/span><\/span><\/span><\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: windowtext 1pt solid; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">Staff<\/span><\/span><\/span><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">Group<\/span><\/span><\/span><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">Att_Modify<\/span><\/span><\/span><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">Member<\/span><\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: windowtext 1pt solid; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">CoffeeClub<\/span><\/span><\/span><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">Group<\/span><\/span><\/span><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">Add<\/span><\/span><\/span><\/td>\n<td style=\"border-right: windowtext 1pt solid; border-top: #ece9d8; border-left: #ece9d8; width: 88.55pt; border-bottom: windowtext 1pt solid; background-color: transparent; padding: 0cm 5.4pt 0cm 5.4pt;\" valign=\"top\" width=\"118\"><span lang=\"EN-GB\"><span style=\"font-size: small;\"><span style=\"font-family: Times New Roman;\">NULL<\/span><\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span lang=\"EN-GB\"><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">In MIIS, refresh the MA&#8217;s schema so that MIIS can see the new column. (Note that the &#8220;Configure attribute-level change&#8221; option will be greyed out until MIIS has registered the extra AttributeName column.) Now set up the <strong>Configure Delta <\/strong>page as shown:<\/span><\/span><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">\u00a0<\/span><\/span><\/span><span lang=\"EN-GB\"><span lang=\"EN-GB\"><br \/><\/span><\/span><\/p>\n<p><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\"><img decoding=\"async\" src=\"https:\/\/www.wapshere.com\/images\/ma-attmodify.GIF\" alt=\"\" \/><\/span><\/span><\/p>\n<p><span lang=\"EN-GB\"><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">The next step is to modify the SQL script you use to generate your Delta table. You are going to need a separate section for each attribute you want to consider separately. <\/span><\/span><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">\u00a0<\/span><\/span><\/span><\/p>\n<blockquote>\n<p><span style=\"color: #339966;\"><span style=\"font-family: Times New Roman;\">\/* member *\/<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span style=\"color: #0000ff;\">INSERT INTO<\/span><span lang=\"EN-GB\"> ADMV_Objects_Delta<\/span><\/span><br \/><span style=\"color: #0000ff;\"><span style=\"font-family: Times New Roman;\">SELECT<\/span><\/span><br \/><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">\u00a0 CASE <span style=\"color: #0000ff;\">WHEN<\/span> a.ObjectID IS NULL <span style=\"color: #0000ff;\">THEN<\/span><\/span><\/span><br \/><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">\u00a0 b.ObjectID <\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span style=\"color: #0000ff;\">\u00a0 ELSE<\/span><span lang=\"EN-GB\"> a.ObjectID <\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span style=\"color: #0000ff;\">\u00a0 END AS<\/span><span lang=\"EN-GB\"> ObjectID,<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #ff0000;\">\u00a0 &#8220;Group&#8221;<\/span> <span style=\"color: #0000ff;\">AS<\/span> ObjectType,<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #ff0000;\">\u00a0 &#8220;Att_Modify&#8221;<\/span> <span style=\"color: #0000ff;\">AS<\/span> ChangeType,<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #ff0000;\">\u00a0 &#8220;member&#8221;<\/span> <span style=\"color: #0000ff;\">AS<\/span> AttributeName<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span style=\"color: #0000ff;\">FROM<\/span><span lang=\"EN-GB\"> ADMV_Values_Snapshot a <span style=\"color: #0000ff;\">FULL<\/span> OUTER JOIN ADMV_Values_Archive b<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span style=\"color: #0000ff;\">ON<\/span><span lang=\"EN-GB\"> a.ObjectID = b.ObjectID <span style=\"color: #0000ff;\">AND<\/span> a.Value = b.Value<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span style=\"color: #0000ff;\">WHERE<\/span><span lang=\"EN-GB\"> (a.AttributeName = <span style=\"color: #ff0000;\">&#8220;member&#8221; <\/span>OR b.AttributeName = <span style=\"color: #ff0000;\">&#8220;member&#8221;<\/span>)<\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span style=\"color: #0000ff;\">AND<\/span> (a.ObjectID <span style=\"color: #0000ff;\">IS<\/span> NULL OR b.ObjectID <span style=\"color: #0000ff;\">IS<\/span> NULL) <\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #339966;\">\u00a0<\/span><\/span><\/span><\/p>\n<p><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #339966;\">\/* dlMemSubmitPerms *\/<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">INSERT INTO<\/span><span lang=\"EN-GB\"> ADMV_Objects_Delta<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">SELECT<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span lang=\"EN-GB\">\u00a0 CASE <span style=\"color: #0000ff;\">WHEN<\/span> a.ObjectID IS NULL <span style=\"color: #0000ff;\">THEN<\/span><\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span lang=\"EN-GB\">\u00a0 b.ObjectID<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">\u00a0 ELSE<\/span><span lang=\"EN-GB\"> a.ObjectID<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">\u00a0 END AS<\/span><span lang=\"EN-GB\"> ObjectID,<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span lang=\"EN-GB\"><span style=\"color: #ff0000;\">\u00a0 &#8220;Group&#8221;<\/span> <span style=\"color: #0000ff;\">AS<\/span> ObjectType,<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span lang=\"EN-GB\"><span style=\"color: #ff0000;\">\u00a0 &#8220;Att_Modify&#8221;<\/span> <span style=\"color: #0000ff;\">AS<\/span> ChangeType,<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span lang=\"EN-GB\"><span style=\"color: #ff0000;\">\u00a0 &#8220;dlMemSubmitPerms&#8221;<\/span> <span style=\"color: #0000ff;\">AS<\/span> AttributeName<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">FROM<\/span><span lang=\"EN-GB\"> ADMV_Values_Snapshot a <span style=\"color: #0000ff;\">FULL<\/span> OUTER JOIN ADMV_Values_Archive b<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">ON<\/span><span lang=\"EN-GB\"> a.ObjectID = b.ObjectID <span style=\"color: #0000ff;\">AND<\/span> a.Value = b.Value<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">WHERE<\/span><span lang=\"EN-GB\"> (a.AttributeName = <span style=\"color: #ff0000;\">&#8220;dlMemSubmitPerms&#8221;<\/span> OR b.AttributeName = <span style=\"color: #ff0000;\">&#8220;dlMemSubmitPerms&#8221;<\/span>)<\/span><\/span><\/span><br \/><span style=\"font-family: Times New Roman;\"><span lang=\"EN-GB\"><span style=\"color: #0000ff;\">AND<\/span> (a.ObjectID <span style=\"color: #0000ff;\">IS<\/span> NULL OR b.ObjectID <span style=\"color: #0000ff;\">IS<\/span> NULL)<\/span><\/span><\/p>\n<\/blockquote>\n<p><span lang=\"EN-GB\"><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">This script as-is does lead to duplicate rows in the Delta table, but MIIS handles that fine. For efficiency it is preferable to remove the dupes by using another table and a SELECT DISTINCT query.<\/span><\/span><\/span><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MIIS gives you the option of specifying individual attributes to include in your delta import. Presumably you could use this to specify which single-valued attribute to import (perhaps the Surname has changed, but nothing else has), but I&#8217;d be surprised if you got much of a performance improvement compared to just re-importing the whole row&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[34,28,5],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-ilm2007","category-miis2003","category-sql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-i","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":4,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":3352,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/18\/revisions\/3352"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}