From c7b44aa5db93acf6d9a9661a0ff1c695d7f6fd74 Mon Sep 17 00:00:00 2001 From: Stevan Earl Date: Thu, 13 Aug 2026 10:41:34 -0700 Subject: [PATCH] Populate ARRIVALS.EID in EVENTS errors --- db/schemas/lib/triggers/create/events.m4 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/db/schemas/lib/triggers/create/events.m4 b/db/schemas/lib/triggers/create/events.m4 index f3bcfe0..ab9d86e 100644 --- a/db/schemas/lib/triggers/create/events.m4 +++ b/db/schemas/lib/triggers/create/events.m4 @@ -226,8 +226,8 @@ CREATE OR REPLACE FUNCTION events_insert_commit_func () || a_animid || '), Value (WATCHES.Date) = (' || a_date - || ': Key (ARRIVALS.EID = (' - || a_eid + || ': Key (ARRIVALS.EID) = (' + || NEW.eid || '): Value (ARRIVALS.Seq) = (' || a_seq || '): Value (ARRIVALS.NestStart) = (' @@ -279,6 +279,7 @@ CREATE OR REPLACE FUNCTION events_delete_commit_func () -- ARRIVALS.Seq can't have gaps, per follow, per arriving individual DECLARE -- ARRIVALS + a_eid arrivals.eid%TYPE; a_seq arrivals.seq%TYPE; a_neststart arrivals.neststart%TYPE; a_nestend arrivals.nestend%TYPE; @@ -301,12 +302,12 @@ CREATE OR REPLACE FUNCTION events_delete_commit_func () -- Within the follow, for N > 1 Is there a Seq = N+1 row, -- but not a Seq = N row? - SELECT arrivals.seq, arrivals.neststart + SELECT arrivals.eid, arrivals.seq, arrivals.neststart , arrivals.nestend, arrivals.swelling, arrivals.datasource , events.behavior, events.start, events.stop , watches.wid, watches.animid, watches.date , roles.pid, roles.role, roles.participant - INTO a_seq , a_neststart + INTO a_eid , a_seq , a_neststart , a_nestend , a_swelling , a_datasource , a_behavior , a_start , a_stop , a_wid , a_animid , a_date @@ -341,7 +342,7 @@ CREATE OR REPLACE FUNCTION events_delete_commit_func () || ' with a Seq of (' || a_seq - 1 || ') to pair with the following ARRIVALS row:' - || ' Key (EID = (' + || ' Key (EID) = (' || a_eid || '): Value (Seq) = (' || a_seq -- 2.34.1