Subject Re: [firebird-support] Updateable View's trigger oddity
Author Dmitry Yemanov
"Bambang P" <bpranoto@...> wrote:
>
> CREATE VIEW VIEW_DUR ( ID,DUR_HOUR,DUR_MIN)
> as SELECT ID,
> cast( DURATION_MINUTES/60 as INTEGER),
> cast( DURATION_MINUTES - ((DURATION_MINUTES/60)*60) as integer)
> from DURATION;

Try this:

from DURATION join RDB$DATABASE on 1=1

In your case, the engine updates the table two times - directly (because a
view without joins/aggregates/etc is considered naturally updatable) and via
the trigger. So it's not a big surprise that some unexpectable things
happen. My suggestion makes the view updatable only via available triggers.


Dmitry