Destination table by variable? - Mailing list pgsql-novice

From Erik Dahlstrand
Subject Destination table by variable?
Date
Msg-id s23af559.027@gw-smtp.hj.se
Whole thread Raw
Responses Re: [despammed] Destination table by variable?
List pgsql-novice
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

pgsql-novice by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Reference and arrays
Next
From: Afton & Ray Still
Date:
Subject: Re: Destination table by variable?