Subject | Re: [Firebird-Architect] the insert into t select * from t infinite loop |
---|---|
Author | Vlad Horsun |
Post date | 2005-07-03T20:25:22Z |
> >> This doesn't fix this problem:Think about subject query i.e.
> >>
> >> SELECT
> >> *
> >> FROM
> >> TableX x
> >> WHERE
> >> x.ID IN (SELECT FIRST 5 y.ID FROM TableY)
> >>
> >> Which is the same problem IMO.
> >
> > No, there are one more problem - INSERT provided by Ann in the
> > subject will loop infinite since SELECT can see new inserted records
> > and never stops.
>
> That's the same reason why the "SELECT FIRST 5 ..." also fails? If the results from the sub-query in
> the IN predicate are first put into a temporary list and that is used as "lookup list" both problems
> are solved.
insert into t
select * from t
Ann talk about more complex query, but actual problem is in the subject of topic
Regards,
Vlad