dbTalk Databases Forums  

Get Position / Get Direct from within SQL Triggers

comp.databases.btrieve comp.databases.btrieve


Discuss Get Position / Get Direct from within SQL Triggers in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
raneskyr
 
Posts: n/a

Default Get Position / Get Direct from within SQL Triggers - 11-28-2003 , 03:37 AM






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

Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: Get Position / Get Direct from within SQL Triggers - 11-28-2003 , 10:20 AM






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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.