Re: Multiple Actions in TRIGGERS - syntax help?
Posted in 1995
M. Stenzler (rpcg@panix.com) wrote: : Anyone know the correct syntax to implement a trigger that : performs multiple actions for a triggereing event? The triggers : manual refers to this as a possibility but shows no example : code that would describe the syntax. : CREATE TRIGGER t_kills2birds : INSERT ON table_1 : REFERENCING NEW AS newrow : FOR EACH ROW ( insert into table_2, insert into table_3 ) : What I need is the *SYNTAX* for the FOR EACH ROW line - ie: : how do you separate the multiple actions performed for each row? : FOR EACH ROW (insert into t_2 values (...), insert into t_3 values (...)) : or : FOR EACH ROW (insert into t_2 values (...); insert into t_3 values (...)) : or : FOR EACH ROW (insert into t_2 values (...) insert into t_3 values (...)) : or something else entirely : anyone know? The Syntax Manual says: FOR EACH ROW (insert into t_2 values (...), insert into t_3 values (...)) and FOR EACH ROW (insert into t_2 values (...)), (insert into t_3 values (...)) are both legal. The Quick Syntax Guide says the same thing. Maybe you're RTing the wrong FM? I don't have 5.1 doc, so I'll give you the benefit of the doubt. -- graeme -- Disclaimer: The author's opinions are his own, and not necessarily those of Pyramid Technology Ltd. or Pyramid Technology Inc. --------------------------------------------------------------------------- -m------- Graeme Sargent Voice: +44 (0)252 373035 ---mmm----- Senior Database Consultant Fax : +44 (0)252 373135 -----mmmmm--- Pyramid Technology Ltd. Telex: Tell who??? -------mmmmmmm- Farnborough, Hants GU14 7PL Email: graeme@pyra.co.uk --------------------------------------------------------------------------- We have the technology. The tricky bit is learning how to use it.