Dear Folks,
I've to write a query that tracks changes made to data by certain users. The query will be written for a known set of tables but each table has a different number of columns. The query needs to display which values have changed, what was the previous value and what's the new value. For example: TableA has following data:
Item ID | Price | Item Desc | Created_by | Updated_by | Created_date | Updated_date | Version_no | |
1 | $1.49 | Lemon Tea | abcuser | abcuser | 2013-08-07 11:07:00am | 2013-08-07 11:07:00am | 0 | |
1 | $ 1.50 | Lemon Tea | abcuser | xyzuser | 2013-08-07 11:07:00am | 2013-08-07 11:15:00am | 1 | |
1 | $ 1.50 | Lemon Tea China | abcuser | ghiuser | 2013-08-07 11:07:00am | 2013-08-07 11:30:00am | 2 | |
There were two changes, a price change and a description change by two different users during two different times. Hence the query | |
should fetch both of the rows. | |
Similiary there are few other tables that contain more number of columns that could be changed by users. The parameter to query will be the name of the table and the date. |
I hope this is quite simple explanation about my issue but if something is not clear please let me know. | |
Thanks. | |