Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating values in record using UPDATE TRIGGER

Status
Not open for further replies.

prangster

MIS
Sep 14, 1999
18
US
I have two fields: one that is a count of how many times a record was updated and one that stores the DATETIME() of the last update. It seems reasonable to use the UPDATE trigger so it will be automatic.

Whenever I try to update a value in the record using the UPDATE TRIGGER (calls updAddressType) I get an error telling me it can't update the cursor.

I am using the following STORED PROCEDURE:

PROCEDURE updAddressType
REPLACE lastupdate_count WITH lastupdate_count + 1
REPLACE lastupdate_at WITH DATETIME()
RETURN .T.
ENDPROC


What am I missing?
 
Triggers cannot effect the record you are currently on - in this case the record being updated. You will need to use a rule instead, they haven't got this limitation.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top