I am trying to search employees based on their code and department.
I triggered a query using IN operator which has 1200 employee codes. When i executed the query I got an exception (‘Maximum 1000 records allowed in IN ‘).
Can anyone help me out with this issue.
Many DBMS don’t allow a query like
with more than 1,000 values in the list. Maybe it is possible to split it up using chunks of less than 1,000 values:
or
(Although it would not make sense and is unlikely to work).
Otherwise, you should store your values in a temporary table and use a JOIN instead. Where do you get your 1,200 codes from — they don’t happen to be in the same database? 🙂