Subject Re: [firebird-support] INSERT INTO SELECT only inserts one row
Author Ann W. Harrison
Rick Debay wrote:

> The only thing I can think of is that the WHERE statement is being
> reevaluated when each row is returned, resulting in no results after the
> first row is inserted into INVC_GRANTEE_INVT.
> Is this what is happening?

Yes. And yes, it violates the standard, and yes, sooner or later it
will get fixed, but absent serious funding, the time scale is years
rather than months.

> Is there any way around it besides using a
> stored procedure and performing an initial select in order to get the
> MAX to pass to the INSERT INTO SELECT?

I'd go with the stored procedure, worry about anything that requires
regular fetching of the MAX of whatever, and be sure to use aliases when
creating even vaguely recursive requests.


Regards,


Ann