Let's say I have the following CPF's:
65568752877
86924355382
55317961378
82331493146
I would like to pass them as a parameter in a query SQL
, I am trying as follows:
SQL Excerpt
... " AND Beneficiario.Codigo IN ('"+codigo+"') ");
And then
List<Cliente> lista = buscar(c, " 65568752877, 86924355382, 55317961378, 82331493146 ");
But of this error:
com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type varchar to bigint.
When I pass only one CPF it works, the problem is when I try to pass more than one.
When I start with values this way it works:
AND Beneficiario.Codigo IN
(65568752877, 86924355382, 55317961378, 82331493146)
NOTE: The codes (CPF) are not fixed, they can change and the number of codes passed by parameters can also change.