Re: Selecting values from comma separated string

Поиск
Список
Период
Сортировка
От Nacef LABIDI
Тема Re: Selecting values from comma separated string
Дата
Msg-id f16f7ea00908260713lf27490cha9c66400ff5f14c5@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Selecting values from comma separated string  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Selecting values from comma separated string
Список pgsql-sql
Here I come again to ask how can I pass an array of values to a pgsql function when I call this function from a delphi program for example.

Nacef



On Wed, Aug 26, 2009 at 3:05 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"A. Kretschmer" <andreas.kretschmer@schollglas.com> writes:
> In response to Nacef LABIDI :
>> I want to write a function that takes as param a comma separated values string
>> and perform a select matching these values.

> Use EXECUTE sql_string,

Safer to use string_to_array, for instance

       ... WHERE id = ANY(string_to_array('1,3,7,8', ',')::int[]) ...

Of course this just begs the question of why the OP doesn't use an
array in the first place.

                       regards, tom lane

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



--
Nacef LABIDI
nacef.l@gmail.com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Selecting values from comma separated string
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Selecting values from comma separated string