Subject | Re: Trigger in wrong time |
---|---|
Author | mmenaz |
Post date | 2002-04-08T19:28:40Z |
--- In IBObjects@y..., "andreventu" <andre_scaravelli@u...> wrote:
like, in BU:
IF (NEW.LOCK_FLG<>'Y') THEN
BEGIN
--- your code
END
ELSE
NEW.LOCK_FLG = 'N';
Regards
Marco Menardi
> Hi all,That's because IB has not a record lock in the traditional sense. IBO does a trick producing a "dummy update" (assigning a field its value) and so activating the transaction versioning stuff (or something like that ;))
>
> I created a trigger before update in my table. When the Pessimistic
> Lock property is set to true, the trigger active when the table
> change to edit mode.
> Shouldn't it active when I post the data? HowYou can't. One trick Geoff Worboys suggested me time ago whas to have a "special field" in each table, like LOCK_FLG char, define your own "LockSQL" in the LockSQL property, and intercept it in triggers. This way you can distinguish the dummy update from the real one (you have to reset the field flag in the afterupdate trigger or at the end of the beforeupdate one, if no afterupdate is defined)
> can I do to active the trigger after the post without set the
> Pssimistic Lock property to false?
like, in BU:
IF (NEW.LOCK_FLG<>'Y') THEN
BEGIN
--- your code
END
ELSE
NEW.LOCK_FLG = 'N';
Regards
Marco Menardi