Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger
Message
 
 
To
07/05/2003 04:02:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00785667
Message ID:
00785690
Views:
14
>>>>hi,
>>>>How to implement trigger that update a datetime field if the record is deleted?
>>>>I tried to call a methos that REPLACE lDeleteTimeStamp WITH DATETIME() but VFP return "cannot update the cursor"
>>>>
>>>>Thank you
>>>
>>>John,
>>>
>>>When a triggers fires for an alias, you cannot change anything at the record and neither can you move the record pointer until the trigger exits
>>>
>>>You can change fields in the record validation rule, but then I do not think it is called for a delete
>>>
>>>Difficult problem
>>
>>I agree, that it could not be done on Database level. It could be done easiliy for SQl Server, but VFP doesn't have that, in my opinion. John will have to do it in code.
>>
>>For update/insert it's easy to update time and userID. For insert use default values and for Update use record level validation.
>
>Nadya,
>
>I remember we had that discussion a while ago. You had a similar problem as I recall. Unfortunately, I do not know anything about SQL server.
In SQL Server you can use deleted table to perform necessary updates. I'll post tomorrow my Delete trigger, it's too late (early) right now)

>
>Shouldn't you be sleeping or are you an early riser ;-)

I really should, it's 4am in the morning... I'm just a little bit depressed with all this tek-tips issue...
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform