Subject Re: [Firebird-Architect] for discussion Transient Data Set
Author Ann W. Harrison
Dmitry Yemanov wrote:
> "Jim Starkey" <jas@...> wrote:
>
>>I would like to see the mechanism broadened so a mass insert can return
>>a transient data set of what actually got stored.
>
>
> Did you think of something like:
>
> INSERT ... RETURNING <col_list> AS <tds_name>


How about adding three more ways to create transient data sets:


INSERT INTO <table>... YIELDING [<col list> AS] <tds_name>

where the <col list> is list of names that match a subset of the column
names in <table>. If no <col list> is specified, columns for
<tds_name> would have the same name and datatypes as the columns in
<table>, including columns not listed in the insert. If <col list> is
specified, columns in the temporary data set will have the same data
type as the column in <table> that has the same name.

DELETE FROM <table> ...
YIELDING [<col list> AS] <tds_name>

with the same rules for columns as above.

UPDATE <table> ...
YIELDING OLD [<col list> AS] <tds_name1>
NEW [<col list> AS] <tds_name2>

with the same rules for columns and the phrase requiring at least one of
OLD or NEW.


Regards,


Ann