Skip to content

Commit

Permalink
Fixed insertTable for dbi connection - relates to OHDSI#278
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-fey-hus committed Jul 18, 2024
1 parent bee58a3 commit e2c1194
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/InsertTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ insertTable.DatabaseConnectorDbiConnection <- function(connection,
}
isSqlReservedWord(c(tableName, colnames(data)), warn = TRUE)

tableName <- gsub("^#", "", tableName)
if (dbms(connection) == "sqlite") {
#tableName <- gsub("^#", "", tableName) #EF: SQL Server needs the hashtag for temp tables
if (dbms(connection@dbiConnection) == "sqlite") {
# Convert dates and datetime to UNIX timestamp:
for (i in 1:ncol(data)) {
column <- data[[i]]
Expand All @@ -430,7 +430,7 @@ insertTable.DatabaseConnectorDbiConnection <- function(connection,
}
}
}
if (dbms(connection) == "spark") {
if (dbms(connection@dbiConnection) == "spark") {
# Spark automatically converts table names to lowercase, but will throw an error
# that the table already exists when using dbWriteTable to append, and the table
# name is not all lowercase.
Expand Down

0 comments on commit e2c1194

Please sign in to comment.