Subject Re: [ib-support] Auditing updates
Author David K. Trudgett
On Monday 2002-02-11 at 11:31:37 +0100, Svein Erling Tysvær wrote:

> Not much of an improvement, but I think
>
> IF ((OLD.mast_Column_Name IS NULL AND
> NEW.mast_Column_Name IS NOT NULL) OR
> (OLD.mast_Column_Name IS NOT NULL AND
> NEW.mast_Column_Name IS NULL)) THEN
> EXECUTE PROCEDURE Audit_The_Change(parameters, ...);
> ELSE IF (OLD.mast_Column_Name <> NEW.mast_Column_Name) THEN
> EXECUTE PROCEDURE Audit_The_Change(parameters, ...);
>
> would suffice (i.e. I don't see your first IF-statement making any
> difference).

I believe that code as you have it would end up logging as a change
every case where OLD is NULL and NEW is NULL (i.e., no change at all).

By the way, I've now put this into an After Update trigger. A Before
Update trigger isn't quite the right place to do logging...

Thanks anyway.


David Trudgett