From 8a6cdbd56040bec960f561ad1e6713437d38411d Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Thu, 10 Oct 2024 12:57:24 +0200 Subject: [PATCH] use executeBatch() rather than executeLargeBatch() on InterSystems IRIS --- R/Sql.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/Sql.R b/R/Sql.R index 5928c72a..c5687a2a 100644 --- a/R/Sql.R +++ b/R/Sql.R @@ -436,7 +436,13 @@ executeSql <- function(connection, tryCatch( { startQuery <- Sys.time() - rowsAffected <- c(rowsAffected, rJava::.jcall(statement, "[J", "executeLargeBatch")) + # InterSystems IRIS JDBC supports batch updates but does not have a separate + # executeLargeBatch() method + if (con@dbms == "iris") { + rowsAffected <- c(rowsAffected, rJava::.jcall(statement, "[I", "executeBatch")) + } else { + rowsAffected <- c(rowsAffected, rJava::.jcall(statement, "[J", "executeLargeBatch")) + } delta <- Sys.time() - startQuery if (profile) { inform(paste("Statements", start, "through", end, "took", delta, attr(delta, "units")))