Re: plpgsql grief - Mailing list pgsql-sql

From Tom Lane
Subject Re: plpgsql grief
Date
Msg-id 18843.981996385@sss.pgh.pa.us
Whole thread Raw
In response to RE: plpgsql grief  (Michael Ansley <Michael.Ansley@intec-telecom-systems.com>)
List pgsql-sql
Michael Ansley <Michael.Ansley@intec-telecom-systems.com> writes:
> 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.

That won't work :-(
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql grief
Next
From: Josh Berkus
Date:
Subject: Re: plpgsql grief