db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Bowman" <petergbow...@hotmail.com>
Subject Derby Trigger Query
Date Sun, 09 Apr 2006 04:37:12 GMT
Hi All,

I have a trigger like:

DROP TRIGGER RULE_10A;

CREATE TRIGGER RULE_10A
	AFTER INSERT ON PLAN_NAME_TABLE
	REFERENCING NEW AS NEWROW
	FOR EACH ROW MODE DB2SQL
	INSERT INTO PLAN_NUTRIENT_TABLE (PLAN, NUTRIENT, NUTRIENT_TYPE, UNITS) 
VALUES (NEWROW.PLAN, 'Total Fat', 'Fat', 'g');


which inserts a new row into a table whenever a new row is inserted into 
another table, but is it possible to use a single trigger to insert several 
rows into the same table or do I have to write a separate trigger for each 
insert.

Thanks in advance,

Peter.



Mime
View raw message