Re: plpgsql grief
От
Michael Fork
Тема
Re: plpgsql grief
Дата
Msg-id
Pine.BSI.4.21.0102121124560.21572-100000@glass.toledolink.com
Ответ на
Re: plpgsql grief (Josh Berkus)
Список
Дерево обсуждения
RE: plpgsql grief Michael Ansley <Michael.Ansley@intec-telecom-systems.com>
Re: plpgsql grief Tom Lane <tgl@sss.pgh.pa.us>
> Thus your only way to get stuff back from EXECUTE is to save > the results you want to a temporary table (using CREATE > TABLE AS ...), and read them back using a query. Not > high-performance, but it gets the job done. > I believe this statement is incorrect, quoting Michael Ansley from a previous e-mail: create function testfunc (text) returns int4 as ' declare sql varchar; begin sql=''SELECT id AS res2 FROM ''||$1 ; execute sql ; return res2; end; ' language 'plpgsql' ; Please note the AS syntax rather than INTO. This was a misconception on my part, which has obviously lasted longer than I'd hoped ;-) I believe this was the consensus reached on the hacker's list..... Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio
В списке pgsql-sql по дате отправления