tablename as function parameter

Поиск
Список
Период
Сортировка
От Hermann Draeger
Тема tablename as function parameter
Дата
Msg-id d17o8m$dfd$01$1@news.t-online.com
обсуждение исходный текст
Ответы Re: tablename as function parameter  (Jonathan Daugherty <cygnus@cprogrammer.org>)
Список pgsql-sql
I'm trying to create a function (language 'sql') with table name as single input parameter,
but I always get syntax errors at "$1". Probably I am use wrong types.

simple example:

create function testfct (text) language sql as 'select count(*) from $1'

fails.

I tested type alternatives to 'text' , such as 'name' or 'sql_identifier' - no success.

What is the right type ?







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

Предыдущее
От: Ashok Agrawal
Дата:
Сообщение: date subtraction
Следующее
От: Jonathan Daugherty
Дата:
Сообщение: Re: Group by 15 Minute Steps