Destination table by variable?

Поиск
Список
Период
Сортировка
От Erik Dahlstrand
Тема Destination table by variable?
Дата
Msg-id s23af559.027@gw-smtp.hj.se
обсуждение исходный текст
Ответы Re: [despammed] Destination table by variable?
Список 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 по дате отправления: