PQexecParams, placeholders and variable lists of params

Поиск
Список
Период
Сортировка
От
Тема PQexecParams, placeholders and variable lists of params
Дата
Msg-id YZzSa7qRtgg/+oLL@tuxteam.de
обсуждение исходный текст
Ответы Re: PQexecParams, placeholders and variable lists of params
Список pgsql-general
Hi,

PQexecParams expects a query string with "$1", "$2"... placeholders,
which refer to as many params in the param list. This keeps SQL
injection at bay.

Is there a way to express "variable length" lists? IOW, if I want to do
a query like

  "SELECT * FROM customers WHERE id IN ($1, $2) AND name like $3;"

is there a way to do that without knowing beforehand how many values go
into the IN list?

It would be very welcome for you to rub my nose against the place in The
Fine Manual where I could have found that :-)

Thanks & cheers
 - tomás

Вложения

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

Предыдущее
От: Shaozhong SHI
Дата:
Сообщение: Re: Regex for Word space Word space Word ....
Следующее
От: Saurabh Agrawal
Дата:
Сообщение: Re: Regex for Word space Word space Word ....