Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call a .prg from a trigger ????
Message
From
27/08/2016 09:14:08
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01640061
Message ID:
01640071
Views:
51
>I haven't really messed with triggers in VFP tables - and wondering if it's possible to do this.
>
>I want to run a .prg from a trigger. Basically what I'm trying to do here is when a record in a table is appended or updated, I want it to also update a remote view. I'd like to so this from the table itself so I don't have to change a huge pile of code. Is this even possible???
>Thanks!

Sure; the whole idea of triggers it to invoke a procedure when one of the three events (insert, delete, update) occurs. I used it in the past for an audit trail.

However, I suggest that instead of a PRG, you have a procedure in the database stored procedures - in the database that contains the table. That's safer, in the way that the stored procedure should always be available.

If you need to, you can use oldval() to get the value of the fields BEFORE doing the change.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform