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  |  [EMAIL PROTECTED]  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to