Re: [SQL] PL/PGSQL function with parameters
От | Florent Guillaume |
---|---|
Тема | Re: [SQL] PL/PGSQL function with parameters |
Дата | |
Msg-id | 20010206221522.A21727@twin.efge.org обсуждение исходный текст |
Ответ на | Re: [SQL] PL/PGSQL function with parameters (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Re: [SQL] PL/PGSQL function with parameters
|
Список | pgsql-hackers |
> > 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 useSELECT expression INTO var FROM ... but Bruce's book, in several examples ("PL/PGSQL Functions" for instance, node203.html) usesSELECT INTO var expression FROM ... Both should work, but there may be there's something to straighten up here. Cheers, Florent -- florent.guillaume@mail.com
В списке pgsql-hackers по дате отправления: