> > SQL = ''SELECT * INTO temp1 FROM '' || $1;
>
> I tried this, and it seems that "SELECT ... INTO foo" is not executed
> correctly by EXECUTE --- the INTO is handled as an ordinary select-into-
> table construct rather than plpgsql's select-into-variable.
>
> While I have not looked closely, I seem to recall that plpgsql handles
> INTO by stripping that clause out of the statement before it's passed to
> the SQL engine. Evidently that's not happening in the EXECUTE case.
>From gram.y, yes it tries to strip the INTO by skipping over some stuff,
maybe the "*" trips it ?
Anyway the syntax SELECT INTO temp1 * FROM .... should work.
On this same subject, the plpgsql doc says to use
SELECT expression INTO var FROM ...
but Bruce's book, in several examples ("PL/PGSQL Functions" for instance,
node203.html) uses
SELECT INTO var expression FROM ...
Both should work, but there may be there's something to straighten up here.
Cheers,
Florent
--
[EMAIL PROTECTED]