Subject Re: [Firebird-Architect] for discussion Transient Data Set
Author Dmitry Yemanov
"Jim Starkey" <jas@...> wrote:
>
> >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?

Mutating tables, in Oracle's terminology:

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 be
> implemented with a standard SQL API.

It requires the second network call which is redundant in most cases.

> There is absolutely no way, for
> example, to graft RETURNING onto ODBC or JDBC.

Connectivity drivers also tend to evolve to support the new engine
functionality. Nothing bad here.


Dmitry