I need to select based on a big list:
SELECT ... FROM tb WHERE tb.cl IN (?, ?, ?, ..................many)
I can't do it this way because the driver implementation (Jaybird) limits the query to 1500 parameters max, also I can't select/load all and filter inside the app because there's not enough memory.
What should I do?
Extra info
I'm using Spring Boot with Hibernate and JPA Repositories, so if could be done in JPQL or using some other environment-related technique it would fit nicer.
I will actually use a ...WHERE tb.cl NOT IN...
, if it makes any difference.
It's kinda like an EDI, I'm connecting two distinct databases, so using a nested select isn't an option.