Re: umlimited arguments on function

Поиск
Список
Период
Сортировка
От Robert Treat
Тема Re: umlimited arguments on function
Дата
Msg-id 200402152145.15276.xzilla@users.sourceforge.net
обсуждение исходный текст
Ответ на umlimited arguments on function  (Christian Hergert <chris@dronestudios.com>)
Список pgsql-sql
On Monday 09 February 2004 14:49, Christian Hergert wrote:
> Is it possible to write a function (in sql or plpgsql) that allows for
> an unknown amount of arguments? Something similar to C's printf()
> function.
>

AFAIK no, but I know of two possible work arounds... first is to write 
multiple copies of the function to accept the different number of argument 
combinations you need.  the other thing i've done in the past is to create 
the function as accepting a array as one of its inputs and then handle the 
array structure as needed. (bonus points for doing the second method in 7.3 
where its much more challenging.)  HTH,

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Passing composite values to functions
Следующее
От: "Denis"
Дата:
Сообщение: Re: ORDER BY TIMESTAMP_column ASC, NULL first