triggers in datatable->trigger tabpage
Wiaz - ¦ro Wrz 26, 2007 7:37 am
" />I have table: CREATE TABLE element ( e_id INTEGER PRIMARY KEY autoincrement, e_nazwa VARCHAR(100), e_dostawca_id INTEGER, e_typ_elementu_id INTEGER, e_magazyn INTEGER default 0, magazyn_w_drodze INTEGER default 0, uwagi TEXT ) and all triggers below are in triggers tabpage when i doubleclick on table mentioned above in treeview
CREATE TRIGGER after_element_delete AFTER DELETE ON element FOR EACH ROW BEGIN DELETE FROM modul_element WHERE me_element_id=OLD.e_id; DELETE FROM element_kod_cena WHERE ekc_element_id=OLD.e_id; END
CREATE TRIGGER after_element_delete AFTER DELETE ON element FOR EACH ROW BEGIN DELETE FROM modul_element WHERE me_element_id=OLD.e_id; DELETE FROM element_kod_cena WHERE ekc_element_id=OLD.e_id; END
CREATE TRIGGER after_dostawca_delete AFTER DELETE ON dostawca FOR EACH ROW BEGIN DELETE FROM element_kod_cena WHERE ekc_dostawca_id=OLD.d_id; UPDATE element SET e_dostawca_id='' WHERE e_dostawca_id=OLD.d_id; END
CREATE TRIGGER after_typ_delete AFTER DELETE ON typ_elementu FOR EACH ROW BEGIN DELETE FROM element WHERE e_typ_elementu_id=OLD.te_id; END
Googie - ¦ro Wrz 26, 2007 12:46 pm
" />That is correct, since triggers tab shows all triggers that are somehow related to table, not only "ON table_name" matching, but also these ones that are used inside of trigger body.
Wiaz - Pon Pa¼ 08, 2007 12:22 pm
" />i was deeply deeply thinking and using many database and... don't like this. dont like triggers that somehow are related to datatable to be included together with that ones that are "ON" that table. because i could have a chain of triggers that would interact with this datatable. for example in my database i have product->modul->element i have triggers that if delete product then modul is deleted, if modul is deleted then element is deleted. In your way of understanding there will be in element table 2 triggers: on element delete and on modul delete but on produkt delete not, but this trigger (on product delete) is also related with element table. i'm using your and other managers and think that only triggers ON this particular table should be included in table triggers tab. in other way it would be and it is confusing a little me:)
thanks for reading me:)
Googie - Czw Pa¼ 11, 2007 7:38 am
" />Ok, I'll change it.
Googie - Wto Pa¼ 30, 2007 6:25 pm
" />Done.
zanotowane.pldoc.pisz.plpdf.pisz.plprzeloty.htw.pl
|