[Info-ingres] Update rule also triggered when inserting rows?

Martin Bowes martin.bowes at ndph.ox.ac.uk
Thu Feb 22 08:56:26 UTC 2018


Do a set printrules; then execute the action you want to check. It will printout the rules executed.

Note that a simple insert will not trigger the update rule...unless the procedure called by the insert rule does an update on the table or does some other action which causes another procedure to fir which does an update on the original table.

Marty

-----Original Message-----
From: nksvg1 at gmail.com [mailto:nksvg1 at gmail.com] 
Sent: 22 February 2018 08:42
To: info-ingres at lists.planetingres.org
Subject: [Info-ingres] Update rule also triggered when inserting rows?

I've got those two rules:

create rule insert_bi_date_asqenh after insert on bi_date_asqenh execute procedure insert_bi_date_asqenh_proc  (
c_grnoe   = new.c_grnoe,
d_episkep = new.d_episkep,
iatreio   = new.iatreio,
end_yper  = new.end_yper
)


create rule update_bi_date_asqenh after update (type) on bi_date_asqenh execute procedure update_bi_date_asqenh  (
c_grnoe   = new.c_grnoe,
d_episkep = new.d_episkep,
iatreio   = new.iatreio,
end_yper  = new.end_yper,
error= new.error,
type=new.type
)

I'm trying to debug the update rule firing when it shouldn't, or I think it shouldn't and I got the impression that the update rule is fired automatically after the insert rule is fired, i.e after a row being insert

Is my assumption correct,or should I look elsewhere?
_______________________________________________
Info-ingres mailing list
Info-ingres at lists.planetingres.org
http://lists.planetingres.org/mailman/listinfo/info-ingres



More information about the Info-ingres mailing list