[open-ils-commits] r17011 - branches/rel_1_6_0/Open-ILS/src/sql/Pg (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 21 21:07:01 EDT 2010


Author: miker
Date: 2010-07-21 21:06:59 -0400 (Wed, 21 Jul 2010)
New Revision: 17011

Modified:
   branches/rel_1_6_0/Open-ILS/src/sql/Pg/999.functions.global.sql
Log:
backport of r17007: retain the indicators on located uri 856 merge during asset merge

Modified: branches/rel_1_6_0/Open-ILS/src/sql/Pg/999.functions.global.sql
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/sql/Pg/999.functions.global.sql	2010-07-22 01:05:58 UTC (rev 17010)
+++ branches/rel_1_6_0/Open-ILS/src/sql/Pg/999.functions.global.sql	2010-07-22 01:06:59 UTC (rev 17011)
@@ -242,7 +242,10 @@
                 ) as t(i int,c text);
     
         FOR i IN 1 .. counter LOOP
-            SELECT  '<datafield xmlns="http://www.loc.gov/MARC21/slim" tag="856">' ||
+            SELECT  '<datafield xmlns="http://www.loc.gov/MARC21/slim"' || 
+			' tag="856"' ||
+			' ind1="' || FIRST(ind1) || '"'  ||
+			' ind2="' || FIRST(ind2) || '">' ||
                         array_to_string(
                             array_accum(
                                 '<subfield code="' || subfield || '">' ||
@@ -259,10 +262,12 @@
                         'id',
                         'marc',
                         'biblio.record_entry',
+                        '//*[@tag="856"][position()=' || i || ']/@ind1|' ||
+                        '//*[@tag="856"][position()=' || i || ']/@ind2|' ||
                         '//*[@tag="856"][position()=' || i || ']/*/@code|' ||
                         '//*[@tag="856"][position()=' || i || ']/*[@code]',
                         'id=' || source_record
-                    ) as t(id int,subfield text,data text);
+                    ) as t(id int,ind1 text, ind2 text,subfield text,data text);
 
             uri_text := uri_text || uri_datafield;
         END LOOP;



More information about the open-ils-commits mailing list