Subject | Re: [Firebird-Architect] for discussion Transient Data Set |
---|---|
Author | Dmitry Yemanov |
Post date | 2005-01-16T09:06:47Z |
"Jim Starkey" <jas@...> wrote:
CREATE TRIGGER T_TREE_BU FOR TREE
ACTIVE BEFORE UPDATE POSITION 0
AS
BEGIN
UPDATE TREE
SET COL = COL + NEW.COL
WHERE ID = NEW.PARENT_ID;
END
I.e. when a trigger modifies the same table. What should return both:
UPDATE TREE SET ... WHERE ID = 1 YIELDING ID, COL -- one row or two?
and
UPDATE TREE SET ... YEILDING ID, COL -- all N rows, but with what values?
isc_dsql_prepare().
functionality. Nothing bad here.
Dmitry
>Mutating tables, in Oracle's terminology:
> >Perhaps. My main worry is whether a YIELDING result can be considered
> >expected/correct after a multiple rows DML statement or not.
>
> Why wouldn't it? Is there a problem you know of?
CREATE TRIGGER T_TREE_BU FOR TREE
ACTIVE BEFORE UPDATE POSITION 0
AS
BEGIN
UPDATE TREE
SET COL = COL + NEW.COL
WHERE ID = NEW.PARENT_ID;
END
I.e. when a trigger modifies the same table. What should return both:
UPDATE TREE SET ... WHERE ID = 1 YIELDING ID, COL -- one row or two?
and
UPDATE TREE SET ... YEILDING ID, COL -- all N rows, but with what values?
> Would we consider both? RETURNING requires a whole new API.It just requires a new statement type to be returned from
isc_dsql_prepare().
> YIELDING does everything RETURNING does plus a lot more, and can beIt requires the second network call which is redundant in most cases.
> implemented with a standard SQL API.
> There is absolutely no way, forConnectivity drivers also tend to evolve to support the new engine
> example, to graft RETURNING onto ODBC or JDBC.
functionality. Nothing bad here.
Dmitry