Re: ways to detect that a table was changed ?
Posted in 1999
Afiq Option 2 sounds workable with Informix. On each of the tables which would need to trigger a refresh, define a stored procedure on INSERT, UPDATE and DELETE which call the same stored procedure which does a SYSTEM call to either run the refresh script or to write to a Unix file that your refresh program would check at regular intervals, and if it finds the right information, then it will run itself. Of course the last is a little like Option 1 - just replace the read from the temporary file with listen for a signal. I dont think Informix stores last modified datetimes in the catalog tables, so Option 3 is out. You could implement Option 4 but IMO Option 2 is probably a cleaner implementation. HTH Sujit hash100@mail.eclipse.net (Atiq Hashmi) on 03/08/99 05:53:50 PM Please respond to hash100@mail.eclipse.net (Atiq Hashmi) To: informix-list@iiug.org cc: (bcc: Sujit Pal) Subject: ways to detect that a table was changed ? Hi, My application needs to refresh its copy of data if some tables are changed. Ideal solutions would be that: 1) Configure Informix to generate a Unix (or some kind of) signal to the applic. when a table(or column of a table) is modified -OR- 2) setup a trigger to run a unix program to generate signal to our applic. But I guess, informix doesn't support above schemes. Or does it ? Or, how about: 3)does informix provide timestamps of tables or columns so an applic. checks periodically if a table or a column was changed(just like timestamps of files)? If this is possible, where is this data in database and how to access it? Otherwise, my other crude options are: 4) define tables to hold timestamps, and setup triggers on every column of every table that needs to be monitored, and the triggers would fill these timestamp-tables which are periodically monitored by applic. 5) Not use create timestamp-tables but have applic. check periodically and do some in-direct processing (and I have few possible thoughts) like doing logical diffs on data etc. We are using informix 7.3 and solaris 2.6. (BTW, the applic. is in Java). Being able to detect a table change is also useful for administrators. Any opinions or experiences that you can share ? Thanks AH