As #1702 shows, we have queries that have the potential of hitting the Oracle limitation of 1000 parameters per query. We should check all queries and fix any potential issues by rewriting or chunking the queries as done for example in nextcloud/mail#4947, nextcloud/server#27187 or #1804.