Subject | Re: [Firebird-Architect] for discussion Transient Data Set |
---|---|
Author | Ann W. Harrison |
Post date | 2005-01-14T17:59:13Z |
Dmitry Yemanov wrote:
no reliable way to get back to it after an insert. A RETURNING clause
would reduce the cost/complexity of storing a tree of related objects.
The solution we currently offer - call gen_id first to get the key, then
do the store - is awkward and a barrier to people moving applications or
even skill sets from other databases to Firebird.
desirable.
But it seems it cannot be done for multiple row updates. So, we have two
options:
update/ delete), but requires a second round trip. Returning works only
with singleton modifications, but works in a singe round trip. I'd
argue that both are valuable in different contexts.
won't
generate an exception?
I think that RETURNING is probably better for connectivity libraries
that want to provide a list of values from a singleton modification.
You raise good points. If YIELDING is part of a query expression, then
a statement like this solves the problem of getting values from a mass
insert...
INSERT INTO <whatever> SELECT <list> FROM <data source> YIELDING ...
A question is whether the ability to return a transient data set from an
update or delete has value, since those operations are not based on a
full query expression.
Regards,
Ann
>That I agree. When a record has a system-generated primary key, there's
>
> Let's get back to the original talks about RETURNING. It's required >for two things: (a) return underlying table data after a DML operation
no reliable way to get back to it after an insert. A RETURNING clause
would reduce the cost/complexity of storing a tree of related objects.
The solution we currently offer - call gen_id first to get the key, then
do the store - is awkward and a barrier to people moving applications or
even skill sets from other databases to Firebird.
>and (b) do it in a single network roundtrip with a base DML.I'm not sure that it's very important, but I understand that it would be
>The latter requirement is very important.
desirable.
But it seems it cannot be done for multiple row updates. So, we have two
options:
>YIELDING works with singleton and mass modification verbs (insert/
> 1) Forget about returning datasets from multiple row updates (my proposal)
> 2) Forget about single network roundtrip (your proposal)
>
> Probably, we could implement both, but it would require two different
>extentions (e.g. both RETURNING and YIELDING) for the affected DML, which
>looks like a mess.
update/ delete), but requires a second round trip. Returning works only
with singleton modifications, but works in a singe round trip. I'd
argue that both are valuable in different contexts.
>tds name for a particular INSERT to ensure this name becomes unique and
> Another issue is namespaces. How should a connectivity library generate a
won't
generate an exception?
I think that RETURNING is probably better for connectivity libraries
that want to provide a list of values from a singleton modification.
You raise good points. If YIELDING is part of a query expression, then
a statement like this solves the problem of getting values from a mass
insert...
INSERT INTO <whatever> SELECT <list> FROM <data source> YIELDING ...
A question is whether the ability to return a transient data set from an
update or delete has value, since those operations are not based on a
full query expression.
Regards,
Ann