Hi!
I want to choose the destination table by a variable. Something like this:
CREATE FUNCTION insert_this(int4, varchar, varchar) RETURNS void AS $$
DECLARE
destTable text;
BEGIN
SELECT INTO destTable get_table_name($1);
INSERT INTO destTable VALUES ($2, $3);
END;
$$ LANGUAGE plpgsql;
Is it possible?
/Erik