Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call a .prg from a trigger ????
Message
De
27/08/2016 09:14:08
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01640061
Message ID:
01640071
Vues:
52
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform