Re: Passing arrays

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Passing arrays
Дата
Msg-id 200302132014.15805.josh@agliodbs.com
обсуждение исходный текст
Ответ на Passing arrays  (Michael Weaver <mweaver@corpusglobe.com>)
Список pgsql-sql
Micheal,

> How do you get an array of elements to be passed to a stored proc such that
> you can use the array in a SELECT statement in the WHERE clause
>  - e.g.  WHERE field IN (array) etc...

There's no easy way, right now.  You'll have to:
1) loop through the array and pass its elements to a comma-delimited TEXT
variable.
2) Build up your query as a dynamic string.
3) Do your query loop as a FOR record IN EXECUTE dynamic_query_string

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

Предыдущее
От: Michael Weaver
Дата:
Сообщение: Passing arrays
Следующее
От: chester c young
Дата:
Сообщение: rownum