Functions and tablenames

Поиск
Список
Период
Сортировка
От Julie Hunt
Тема Functions and tablenames
Дата
Msg-id 002701bfa5dd$cfc346a0$9a14a8c0@julies
обсуждение исходный текст
Список pgsql-sql
Hi
I would like to create a function that passes a tablename as a variable, but I do not know what 'datatype' a tablename is supposed to be.
 
CREATE FUNCTION find_max_id(int4, tablename?) RETURNS int4
AS 'Select max($1) FROM $2'
LANGUAGE 'sql';
 
When I put text as the datatype for the tablename the error was a problem near $2.
Could someone please help me.
Thanks
Julie Hunt

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

Предыдущее
От: Patrik Kudo
Дата:
Сообщение: Re: sum a subquery?
Следующее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: Function xxxx() does no exist