webco_8.0
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
check_updated_barcode_label_id
Parameters
Name
Type
Mode
Definition
BEGIN PERFORM true FROM resource WHERE old.obj_oid <> obj_oid AND (barcode = NEW.barcode OR barcode = NEW.label_id); IF FOUND THEN RAISE EXCEPTION 'barcode % is a duplicate', NEW.barcode; END IF; PERFORM true FROM resource WHERE old.obj_oid <> obj_oid AND (label_id = NEW.barcode OR label_id = NEW.label_id); IF FOUND THEN RAISE EXCEPTION 'label_id % is a duplicate', NEW.label_id; END IF; RETURN NEW; END