I am trying to implement Insert and update triggers in my application to handle auditing needs. Each table has a pair or date and userid fields showing create and last modified.
I want to use triggers to update these fields so that I can support both the UI and batch processing.
The trigger code is stored in the DBC as a Stored Procedure (ie. PROCEDURE _inser_tablename) and I call the code from the Update trigger of the table (ie _insert_tablename() )
For some reason the system keeps reporting that is "cannot update cursor" when I insert a new record (ie INSERT INTO TABLE (fields) VALUES (values) ). If I remove the trigger call the insert works fine.
Is there a good FAQ or whitepaper on implementing triggers like this? I can do this with no problems in other packages but VFP is not very clear.
Jon B
Sample trigger code:
PROCEDURE _table_insert_audit
SELECT table
REPLACE table.createdt WITH DATETIME(),;
table.createid WITH vCurrentUser,;
table.lastmoddt WITH DATETIME(),;
table.lastmodid WITH vCurrentUser
Jonthan A Black
I want to use triggers to update these fields so that I can support both the UI and batch processing.
The trigger code is stored in the DBC as a Stored Procedure (ie. PROCEDURE _inser_tablename) and I call the code from the Update trigger of the table (ie _insert_tablename() )
For some reason the system keeps reporting that is "cannot update cursor" when I insert a new record (ie INSERT INTO TABLE (fields) VALUES (values) ). If I remove the trigger call the insert works fine.
Is there a good FAQ or whitepaper on implementing triggers like this? I can do this with no problems in other packages but VFP is not very clear.
Jon B
Sample trigger code:
PROCEDURE _table_insert_audit
SELECT table
REPLACE table.createdt WITH DATETIME(),;
table.createid WITH vCurrentUser,;
table.lastmoddt WITH DATETIME(),;
table.lastmodid WITH vCurrentUser
Jonthan A Black