I've a scenario in which I need to update a date field for more than 1000 records.
I was using native query but then got the error ora-01795 maximum number of expressions in a list is 1000
.
Upon checking I found solutions like breaking the in clause like mentioned in this answer.
But I'm finding this solution, not a very clean one.
Is there any other approach I can use in Spring that is a bit cleaner? Please suggest.
My current query is like:
@Modifying
@Query(value = "UPDATE MY_TABLE SET FLAGGED_DATE = :date WHERE ID IN (:ids)", nativeQuery = true)
void updateFlaggedDate(List<Long> ids, Date date);
The Ids I'm passing in list is being collected from a 3rd party API.