Prepared statement parameters for an 'IN ()' clause

Поиск
Список
Период
Сортировка
От Jason L. Buberel
Тема Prepared statement parameters for an 'IN ()' clause
Дата
Msg-id 47161E1B.9000508@buberel.org
обсуждение исходный текст
Ответы Re: Prepared statement parameters for an 'IN ()' clause  (Sam Mason <sam@samason.me.uk>)
Re: Prepared statement parameters for an 'IN ()' clause  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список pgsql-general
Can someone point me to an example of creating a prepared statement for a query with an 'IN' clause?

The query looks like this:

select value from table where
state = $1 and city = $2 and zip = $3 and
date in ( $4 );

For the prepared statement, I have tried:

prepare st1(text, text, text, text[] );

Then invoked it as:

execute st1('CA', 'SUNNYVALE', '94086', '{2007-10-01,2007-09-25,2007-09-15}' );

But the use of the text array as input parameter does not seem to be correctly used in the 'IN' clause. My query consistently returns no results.

Any quick syntax fix for this?

Thanks
Jason

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: [HACKERS] CVS and Eclipse
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: What encoding to use for English, French, Spanish