[fpc-pascal] Sqldb - How to pass an array of values as a param to be used with SQL IN operator?

Luiz Americo Pereira Camara luizamericop at gmail.com
Sun Apr 10 20:49:42 CEST 2016

2016-04-10 11:01 GMT-03:00 Tony Caduto <tony.caduto at gmail.com>:

> Did you try putting quotes around the param ID in the sql query?
> in(":myparam")
> I am guessing it's the commas that are the problem.

Its the other way around the problem is the quotes

See the attached app.

When using Select * from Test where Id in (1,3) it works

but using Select * from Test where Id in (:idlist) and doing the param
binding does not work because is translated into:
Select * from Test where Id in ('1,3')

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160410/98f7785e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: project1.lpr
Type: application/octet-stream
Size: 1409 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160410/98f7785e/attachment.obj>

More information about the fpc-pascal mailing list