> but then I got 
> to wondering if simply putting code in the ON UPDATE trigger to send the 
> old record to a "history" table would be a more complete (and long term 
> EASIER) solution, whereby my app would query the "history" table for 
> changes.

I have a custom add-on to our core product that does exactly this.

It adds a new table to hold the audit log of changes. It also adds several 
other metadata tables which store details of which tables and fields are to be 
audited. You can nominate a table, field and whether you want to track one or 
more of insert, update and deletes. The database schema is updated based on 
this to add the relevant insert\update\delete triggers on the tables. The 
triggers call a stored procedure which updates the audit table based on the old 
and current values of the relevant fields.

-- 
  Alan Bourke
  alanpbourke (at) fastmail (dot) fm

On Mon, 22 Apr 2019, at 8:34 PM, MB Software Solutions, LLC wrote:
> VFP9SP2 app, MariaDB 10 (MySQL) backend.
> 
> One of my clients asked about a history of price changes.  Easy enough 
> to implement programmatically for the few price fields, but then I got 
> to wondering if simply putting code in the ON UPDATE trigger to send the 
> old record to a "history" table would be a more complete (and long term 
> EASIER) solution, whereby my app would query the "history" table for 
> changes.
> 
> Your thoughts for tracking price (or other) changes?
> 
> tia,
> --Mike
> 
> 
> 
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> 
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to