Subject Re: [ib-support] Again on the updatable views with triggers
Author Claudio Valderrama C.
"Marco Lauria" <mslauria@...> wrote in message
news:5.0.2.1.2.20011126184229.0377dc40@......
> Hi All,
> I thought about this problem and I think that the solution can be
> to return 1 in rows affected for both the insert and update command
against
> a view
> instead of zero.
> Infact I think that even if the insert or the update are spawn across
> several tables,
> the result for the view is that the row with which we are dealing is
> inserted and / or updated.
> Also this can solve the problem with IBO.

No. If you knew the code, you would see that it's called several times, at
least three: before, on the operation and after. Putting more checks there
is like inviting a bug to appear. The API returns the number of direct
operations done. It works for tables. The problem is that views don't really
have I/O so when you only operate through triggers in non-updatable views,
no op is returned, as triggers are never counted. And I already explained
that triggers may perform any number of operations.
I may consider (subject to other FB members' opinions) in the future
returning the sum of all I/O operations done by triggers in another item of
the same API call, but I won't twist the server to do what you are
suggesting, sorry.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing