On Thu, 6 Jun 2002, Ferdinand Smit wrote:
> When i create a function with a "static" table name, it works fine.
> EXECUTE does not allow SELECT INTO, so does anyone have an other solution?
Use:
DECLARE
cursorname refcursor;
varname int;
BEGIN
OPEN cursorname FOR EXECUTE ''SELECT ... FROM '' || $1 || ...;
FETCH cursorname INTO varname;
CLOSE cursorname;
RETURN varname;
END;
--
Joel BURTON | joel(at)joelburton(dot)com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant