The best way to find out is to benchmark. I’m doing two benchmarks for this:
One that is run in PL/SQL, showing the performance difference between different approaches that are available to PL/SQL (namely looping, the
FORALLsyntax, and a single bulk
One that is run in Java, doing JDBC calls, showing the performance difference between different approaches available to Java (namely looping, caching
PreparedStatementbut still looping, batching, and a single bulk
The results tend to be even more dramatic on SQL Server, where the row-by-row overhead is even greater.