MS Techie
2009-01-19 13:11:02 UTC
In a bank , there is nothing that gets deleted ,but gets marked for delete
and the next time a select statement is issued ,those "rows marked for
delete" should not be shown in the future. Of course they would be a history
table which keeps a track of DML statements (Create, Update,Delete
operations) issued and holds the details for every transaction... Now this
being said. HOW DO WE IMPLEMENT THIS SCENARIO,
I believe this is the approach to be taken. Please correct me if I am wrong.
For every table ,which has data, we need to create a history table for
every table, which has the same structure as the original table. Now for
every DML operation like Insert, Update or delete that takes place on the
original table, we are supposed to have triggers which would insert values to
the history tables.
Now assuming that there is no permission for the user to delete (i.e. GRANT
DELETE permission is taken off),how do we mark something for delete and still
capture the delete triggers to work. How is it exactly implemented in the
bank scenarios ?
and the next time a select statement is issued ,those "rows marked for
delete" should not be shown in the future. Of course they would be a history
table which keeps a track of DML statements (Create, Update,Delete
operations) issued and holds the details for every transaction... Now this
being said. HOW DO WE IMPLEMENT THIS SCENARIO,
I believe this is the approach to be taken. Please correct me if I am wrong.
For every table ,which has data, we need to create a history table for
every table, which has the same structure as the original table. Now for
every DML operation like Insert, Update or delete that takes place on the
original table, we are supposed to have triggers which would insert values to
the history tables.
Now assuming that there is no permission for the user to delete (i.e. GRANT
DELETE permission is taken off),how do we mark something for delete and still
capture the delete triggers to work. How is it exactly implemented in the
bank scenarios ?