odbc icon indicating copy to clipboard operation
odbc copied to clipboard

Feature/db2 temp tables

Open detule opened this issue 1 year ago • 0 comments

This is an attempt at finishing off https://github.com/r-dbi/odbc/pull/461

  • Rebased on top of main
  • Rather than customizing both dbListTables and dbExistsTable, opted to specialize odbcConnectionTables. I think this resulted in a much lighter touch.

More detail on temporary tables in DB2 here.

> conn@info
$dbname
[1] "SAMPLE"

$dbms.name
[1] "DB2/LINUXX8664"

$db.version
[1] "11.05.0800"
...
$drivername
[1] "libdb2.a"

$odbcdriver.version
[1] "03.51"
....

DBI::dbExecute(conn, sqlCreateTable(conn, "testtbl", df, temporary = TRUE))
[1] -1
DBI::dbExecute(conn, sqlCreateTable(conn, "testtbl2", df, temporary = TRUE))
[1] -1
dbExistsTable(conn, name = "testtbl")
[1] TRUE
dbExistsTable(conn, name = "testtbl", schema_name = "SESSION")
[1] TRUE
dbExistsTable(conn, name = "testtbl2")
[1] TRUE
dbExistsTable(conn, name = "testtblnothere")
[1] FALSE
dbListTables(conn, schema_name="SESSION")
[1] "testtbl2" "testtbl"

detule avatar Jun 25 '24 02:06 detule