Page 1 of 1

PostPosted: Mon Jul 10, 2006 3:13 pm
by Aoirthoir
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.

PostPosted: Mon Jul 10, 2006 3:16 pm
by shannah
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!

PostPosted: Mon Jul 10, 2006 3:50 pm
by 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.)

PostPosted: Mon Jul 10, 2006 5:42 pm
by shannah
>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?

PostPosted: Mon Jul 10, 2006 7:30 pm
by Aoirthoir
Sounds good. When we have it all done I will post it.