previous cast solution didn't work. casting inline instead
authorberick <berick@commidore64.esilibrary.com>
Thu, 21 Apr 2011 18:27:41 +0000 (14:27 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 6 Jul 2011 18:50:49 +0000 (14:50 -0400)
Open-ILS/src/sql/Pg/012.schema.vandelay.sql

index f95c4f1..3a69144 100644 (file)
@@ -492,10 +492,9 @@ BEGIN
     incoming_existing_id := oils_xpath_string('//*[@tag="901"]/*[@code="c"][1]',NEW.marc);
 
     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;
+        SELECT id INTO tmp_rec FROM biblio.record_entry WHERE id = incoming_existing_id::bigint;
         IF tmp_rec IS NOT NULL THEN
-            INSERT INTO vandelay.bib_match (queued_record, eg_record, quality) VALUES ( NEW.id, incoming_existing_id, 9999);
+            INSERT INTO vandelay.bib_match (queued_record, eg_record, quality) VALUES ( NEW.id, incoming_existing_id::bigint, 9999);
             RETURN NEW;
         END IF;
     END IF;