3
Let’s say I have the following CPF's:
65568752877
86924355382
55317961378
82331493146
I would like to pass them as a parameter in a consultation SQL
, I’m trying this way:
Snippet
... " AND Beneficiario.Codigo IN ('"+codigo+"') ");
And then
List<Cliente> lista = buscar(c, " 65568752877, 86924355382, 55317961378, 82331493146 ");
But make that mistake:
com.microsoft.sqlserver.jdbc.Sqlserverexception: Error Converting data type varchar to bigint.
When I just pass a CPF works, the problem is when I try to pass more than one.
When I spin it with the values that way it works:
AND Beneficiario.Codigo IN
(65568752877, 86924355382, 55317961378, 82331493146)
NOTE: Codes (CPF) are not fixed, they can change and the amount of codes passed by parameters can also change.
Post blocks of code instead of snippets, it’s easier to try to help you.
– Jéf Bueno