Skip to Content
0
Feb 26, 2014 at 11:42 AM

Inconsistent behaviour of Sybase SQL anywhere update column trigger

30 Views

Hi, all

I am not sure where to post this issue, since I could not find a forum for Sybase SQL anywhere.

The problem is as follows:

The definition of the update column trigger in help is this:

//--------------------------

UPDATE OF column-list Invokes the trigger whenever a row of the associated table is updated such
that a column in the column-list is
modified.

//-----------------------------
However, there are cases when the triggers are launched even when the columns are not modified (ie the same exact value is in the both OLD and NEW row)

This happens on BEFORE triggers, never saw it happening on AFTER.

Ways to replicate the problem:

1. Define a before trigger, which fires on update of a specific column in any table.

2. Run an sql which says "update table1 set column1 = column1 where ... "

3. You will see that trigger fires, even though it is not supposed to.

Is this an expected behaviour on "BEFORE" triggers?

Arcady