Re: Creating triggers with joins
Posted in 1998
joel_anderson@prosolution.com wrote: > I have need to create insert, delete, and update triggers for a table that > execute when data in a second related table meets certain conditions. For > example, table A and B may look like this: > TABLE A > Id Name State > 1234 Bob MN > 2233 John FL > Table B > Id Car_Color > 1234 Blue > 2233 Red > Is it possible to create triggers in Table A that update, delete, or insert a > row, only when the car color for that same person Id is Blue (the associated > row in table B has Blue in the Car_Color column). You can have the trigger execute a stored procedure which returns an error if the required conditions are not met. Then your applications can rollback the transaction. Art S. Kagel