PQexecParams, placeholders and variable lists of params - Mailing list pgsql-general

From
Subject PQexecParams, placeholders and variable lists of params
Date
Msg-id YZzSa7qRtgg/+oLL@tuxteam.de
Whole thread Raw
Responses Re: PQexecParams, placeholders and variable lists of params
List 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

Attachment

pgsql-general by date:

Previous
From: Shaozhong SHI
Date:
Subject: Re: Regex for Word space Word space Word ....
Next
From: Saurabh Agrawal
Date:
Subject: Re: Regex for Word space Word space Word ....