Michael Ansley <Michael(dot)Ansley(at)intec-telecom-systems(dot)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