r-dbi / DBI

A database interface (DBI) definition for communication between R and RDBMSs

Home Page:https://dbi.r-dbi.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dbWriteTable and dbAppendTable get ORA-00955 error table already exists

capitantyler opened this issue · comments

I have an Oracle Connection

_> DBI::dbGetInfo(conn)
$dbname
[1] ""
$dbms.name
[1] "Oracle"
$db.version
[1] "19.00.0000"
$username
[1] "USR_REPORTE_FRAUDES"
$host
[1] ""
$port
[1] ""
$sourcename
[1] "Default"
$servername
[1] "xxxxxx.redlink.com.ar:1521/PRULES_SRV"
$drivername
[1] "SQORA32.DLL"
$odbc.version
[1] "03.80.0000"
$driver.version
[1] "12.01.0020"

$odbcdriver.version
[1] "03.52"
$supports.transactions
[1] TRUE
$getdata.extensions.any_column
[1] TRUE
$getdata.extensions.any_order
[1] TRUE
attr(,"class")
[1] "Oracle" "driver_info" "list"_

And I tried to dbWriteTable 2 times with append = TRUE or dbAppendTable. But neither works.

dbWriteTable(

  • conn = conn,
  • name = Id(
  • schema = "USR_REPORTE_FRAUDES", table = "TIPO_CAMBIO3"
    
  • ),
  • value = iris,
  • batch_rows = 1,
  • append = TRUE
  • )
    Error: nanodbc/nanodbc.cpp:1710: HY000
    [Oracle][ODBC][Ora]ORA-00955: este nombre ya lo está utilizando otro objeto existente

dbAppendTable(

  • conn = conn,
  • name = Id(
  • schema = "USR_REPORTE_FRAUDES", table = "TIPO_CAMBIO3"
    
  • ),
  • value = iris,
  • batch_rows = 1
  • )

sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Argentina.utf8 LC_CTYPE=Spanish_Argentina.utf8
[3] LC_MONETARY=Spanish_Argentina.utf8 LC_NUMERIC=C
[5] LC_TIME=Spanish_Argentina.utf8

time zone: America/Buenos_Aires
tzcode source: internal

attached base packages:
[1] graphics grDevices utils datasets stats methods base

other attached packages:
[1] sodium_1.3.1 dbplyr_2.4.0 forcats_1.0.0
[4] stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2
[7] readr_2.1.4 tidyr_1.3.0 tibble_3.2.1
[10] ggplot2_3.4.4 tidyverse_2.0.0 openxlsx_4.2.5.2
[13] rlang_1.1.2 glue_1.6.2 pool_1.0.1
[16] DBI_1.1.3 odbc_1.4.0.9000 lubridate_1.9.3
[19] data.table_1.14.10

loaded via a namespace (and not attached):
[1] bit_4.0.5 gtable_0.3.4 compiler_4.3.2 tidyselect_1.2.0
[5] Rcpp_1.0.11 zip_2.3.0 blob_1.2.4 later_1.3.2
[9] scales_1.3.0 R6_2.5.1 generics_0.1.3 munsell_0.5.0
[13] pillar_1.9.0 tzdb_0.4.0 utf8_1.2.4 stringi_1.8.3
[17] bit64_4.0.5 timechange_0.2.0 cli_3.6.2 withr_2.5.2
[21] magrittr_2.0.3 grid_4.3.2 rstudioapi_0.15.0 hms_1.1.3
[25] lifecycle_1.0.4 vctrs_0.6.5 box_1.1.3 fansi_1.0.6
[29] colorspace_2.1-0 tools_4.3.2 pkgconfig_2.0.3

Thanks. Are you using the ROracle package to connect? This is unlikely to be an issue with the DBI package.

I am using odbc, where
I spotted better the problem in this issue:
r-dbi/odbc#702