Subject Re: insert into .. select from table, procedure
Author maximshiryaev
Hi.

Probably you misguide SQL engine by old join syntax.

Try standard JOIN:

select s.id, s.statsvalue1, s.statsvalue2, s.statsvalue3
from sourcetable t
left join gen_stats(t.id) s on 1=1

When you select "from TABLE, PROC" you cannot be sure that the first
object scanned will be the table not procedure (with not initialized
parameters).

Maxim.