Subject Re: Returning generated key was Re: [Firebird-Architect] Re: Indexed Views
Author Ivan Prenosil
> From: "Ann W. Harrison"
> At 07:36 AM 12/23/2004, Jim Starkey wrote:
> > >
> >That's a different issue. What was proposed was an open ended INSERT
> >... RETURNING <variable>...
>
> What gets returned for a mass insert? Or is the RETURNING only
> allowed for a singleton insert?

For mass insert multiple rows of keys must be returned.
The SQL command for returning multiple rows is SELECT.
Why not modify it ? E.g. allow construct like this

SELECT id
FROM
INSERT INTO tab ...

where SELECT clause can contain any fields from "tab" table,
only single INSERT is allowed after FROM (no JOINs etc.),
other clauses (WHERE, ORDER BY, etc) may or may not be allowed ...

Ivan