One more trigger question

From: The Magnet <art_at_unsu.com>
Date: Tue, 8 Sep 2009 12:51:51 -0700 (PDT)
Message-ID: <c4ac5015-d95c-40e1-9afe-054c369c0da7_at_j39g2000yqh.googlegroups.com>


Ok, this one represents a dumb setup by the client. The client has a table which holds which email product(s) his customers get. Call this table 'ACTIVE':

ACTIVE



CUSTOMER_ID
PRODUCT_ID They also have a history table which shows all the opt outs and opt ins. Call this table INACTIVE:

INACTIVE



CUSTOMER_ID
PRODUCT_ID
TIME
SOURCE The SOURCE column identifies where the opt out came from. AOL, HOTMAIL, In House, etc. Problem is that the active & history tables are not in sync and do not properly reflect the activities. The system is way to big to put in fixes. So I figured a trigger on the ACTIVE table and start recording to a new history table. The active table is correct, just not the history table. A trigger will make sure every change to the active table is recorded.

Problem being that the SOURCE column does not come into account when dealing with the ACTIVE table. So, I do not think a trigger works on the ACTIVE table as you cannot just pass values using a trigger.

So problem being, how to put a trigger on the active table such that when a DELETE occurs we can properly record the SOURCE in the history table. The trigger will ensure the history is recorded properly.

Dumb, very dumb. Not even sure INSTEAD OF triggers will work here..... Received on Tue Sep 08 2009 - 14:51:51 CDT

Original text of this message