History Tables and Undo
5 posts
• Page 1 of 1
A lot of our tables get changed by temps. Sometimes those changes are incorrect of course. We've had them change entirely wrong records. So we are setting up a history. Basically we will be usign MySQL triggers which will copy a record every time it is written, from the first add. The table it copies to will have all of the fields of the original table, plus some additional fields for tracking, like the date, the user who made the change, such like that. In order to view the tables we will be setting up a simple dataface relationship. Currently, if we need a record back, we will just do a straight SQL statement to copy it over. In the future with the new actions abilities in Dataface, we should be able to make the process a simple point and click function.
If you can post some sample code (especially for the mysql trigger part) I'm sure that this sort of thing would be of interest to a lot of users. Makes for a nice recipe, at least.
Thanks for posting this Aoirthoir!
In Sign Language, thanks for thanking me Mr. Steve. (That's how you say your welcome in sign)
Anyhow My gal and I should be working on the triggers tonight. So I will post as soon as I have something solid. Also, do you think a recipes section of the site would be good? (Actually this is the kind of thing I would like to see in the central repository we were talking about earlier. Currently the code I will be working on will be hard coded SQL for the trigger..but if it is possible I would like to move it to a generic stored procedure which can be called from any trigger...I dont know how to do that just yet.)
>Also, do you think a recipes section of the site would be good?
How about posting it in the "how-to" section of the documentation?
5 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 19 guests |