Subject | Re: [firebird-support] Updateable View's trigger oddity |
---|---|
Author | Dmitry Yemanov |
Post date | 2005-09-04T06:42:02Z |
"Bambang P" <bpranoto@...> wrote:
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
>Try this:
> 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;
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