Re: [HACKERS] Re: [SQL] PL/PGSQL function with parameters

2001-02-08 Thread Tom Lane
> Josh Berkus wrote: >> If you think that's the best way. What we're really all wanting is a wy >> in PL/pgSQL to pass a parameter as an object name. Doing it *without* >> using EXECUTE would be even better than modifying EXECUTE to accomdate >> SELECT ... INTO variable. >> >> If we can write q

Re: [HACKERS] Re: [SQL] PL/PGSQL function with parameters

2001-02-08 Thread Jan Wieck
Tom Lane wrote: > Michael Ansley <[EMAIL PROTECTED]> writes: > > CREATE FUNCTION table_count(varchar) RETURNS integer AS ' > > DECLARE > > SQL varchar; > > RES integer; > > BEGIN > > SQL = ''SELECT * INTO temp1 FROM '' || $1; > > EXECUTE SQL; > > SELECT count(*) INTO RES FROM temp1; > > RETU