Table as parameter

Поиск
Список
Период
Сортировка
От Alex Paulo
Тема Table as parameter
Дата
Msg-id 90b77fd70908140525v41315b47j80ed2af14c04f67e@mail.gmail.com
обсуждение исходный текст
Ответы R: Table as parameter
Re: Table as parameter
Список pgsql-general
Friends of pgsql-general list,

I have a problem: I need put the "table name" as a parameter in a function!
So, When I write, inside that function, the following code:

SELECT INTO var_resposta SUM(campo) FROM $1
return var_resposta;

Knows that $1 is the table name, the postgres said that this is a sintax error, exactly at $1 position!
Somebody can help me?

Thank you for taking the time!

Best Regards, Alex Paulo.

В списке pgsql-general по дате отправления:

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: PQoidValue - isn't it for...?
Следующее
От: Scara Maccai
Дата:
Сообщение: adding a nullable col could rewrite the whole table?