From: berick Date: Thu, 21 Apr 2011 17:52:49 +0000 (-0400) Subject: repaired some thinko's in vandelay.match_bib_record stored proc X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=091e82590d2d7b63fa4e882cbc9681b470ba97e2;p=evergreen%2Fjoelewis.git repaired some thinko's in vandelay.match_bib_record stored proc --- diff --git a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql index 7b4ba02e2e..f95c4f1a52 100644 --- a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql +++ b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql @@ -491,10 +491,11 @@ BEGIN incoming_existing_id := oils_xpath_string('//*[@tag="901"]/*[@code="c"][1]',NEW.marc); - IF incoming_existing_id IS NOT NULL THEN - SELECT id INTO tmp_rec FROM biblio.record_entry WHERE id = exact_id; + IF incoming_existing_id IS NOT NULL AND incoming_existing_id != '' THEN + incoming_existing_id := incoming_existing_id::bigint; + SELECT id INTO tmp_rec FROM biblio.record_entry WHERE id = incoming_existing_id; IF tmp_rec IS NOT NULL THEN - INSERT INTO vandelay.bib_match (queued_record, eg_record, quality) VALUES ( NEW.id, exact_id, 9999); + INSERT INTO vandelay.bib_match (queued_record, eg_record, quality) VALUES ( NEW.id, incoming_existing_id, 9999); RETURN NEW; END IF; END IF;