From: | Michael Fork <mfork(at)toledolink(dot)com> |
---|---|
To: | Josh Berkus <josh(at)agliodbs(dot)com> |
Cc: | rob <rob(at)dsvr(dot)net>, pgsql-sql(at)postgresql(dot)org |
Subject: | Re: plpgsql grief |
Date: | 2001-02-12 16:28:30 |
Message-ID: | Pine.BSI.4.21.0102121124560.21572-100000@glass.toledolink.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
> 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
<Michael(dot)Ansley(at)intec-telecom-systems(dot)com> from a previous e-mail:
<QUOTE>
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 ;-)
</QUOTE>
I believe this was the consensus reached on the hacker's list.....
Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-02-12 16:45:18 | Re: plpgsql grief |
Previous Message | Tomek Zielonka | 2001-02-12 16:24:54 | Re: Wierd postgres Problem |