Subject Insert Returning
Author Ann Harrison
I've been going over my list of little features that
might make people's lives better and ran across this.

Internally, InterBase has a blr verb called blr_store2.
Its arguments are a list of assignments between a
message fields and columns, and a list of assignments
between columns and message fields. In short, it
returns a list of values.

Something like:

insert into <table> (<col list>)
values (<val list>)
returning <col list>
into <var list>

Useful for values set by triggers and generators.

In GDML this worked nicely, because a STORE (insert)
never created more than one row. Where SQL would
say
insert into <table> (<col list>)
select <col list> from <selection expression>

GDML would say

for <selection expression>
store <ctx> in <table>
begin
<assignment list>
end;
end_for;

In the GDML case, returning one set of values for each
insertion makes sense, just like returning values from
nested loops.

The SQL mass operation is another kettle of fish - and
one of the reasons I particularly like languages that
use one syntax for two semantically different operations,
but lets not get into that.

Any thoughts?

Ann