A few thoughts:
1) If you define an UPDATE trigger on a file, then that file can not be
updated from Btrieve applications any longer. This is a limitation in the
database yet that has not been worked around. (It only works if all of
your access code is SQL-based.) Obviously, you'll want to be careful with
this.
2) You cannot do a GetPosition call from SQL (or if you can, Pervasive
hasn't documented it yet). You'll need to pass a unique value to the SQL
side, somehow. Of course, IF you can use triggers, then you should know
that the OLD and NEW records are provided on an UPDATE trigger, so you can
simply extract the needed fields from the OLD record set.
3) Instead of re-inventing the wheel, I'd recommend a serious look at
Pervasive AuditMaster, which already does exactly what you need. It works
at the MKDE level, so it captures ALL changes from all applications and
doesn't rely on triggers. It builds an auditing database that can be
searched, scanned, and reported on very easily, and even incorporated into
your application. It does require Pervasive.SQL V8, but this version runs
so much better than older ones, anyway.
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Pervasive.SQL Service & Support Classes ***
Chicago: March, 2004: See our web site for details!
raneskyr wrote:
Quote:
Hi,
I want to write an "agent" program that detects updates on tables and
sends messages to an application. In order to do that, I thought that
a trigger (defined on UPDATE) catch this event and notify the
application with the updated table name, and the location of the
updated record. The updated record location can be retrieved through a
"Get Position" pervasive call, but how do I do this from within SQL
code?
TIA
Dennis |