We can create our temporary tablesunder a specific "DELETE" schema in our database (by temporary I mean temporary use and the tables under this schema can be cleaned up by database maintenance. This might be different the temporary table concept in certain databases) . To access this non-default schema, I read Schema selection but many examples doesn't work.
I didn't create an github issue because I'm not sure which package might be responsible for the error (and we don't have access to github in company).
I'm connecting the database (IBM DB2) with odbc and DBI.
-
read works
dplyr::tbl(con, dbplyr::in_schema("DELETE", "sometable"))
-
but I cannot create table
copy_to(con, iris, dbplyr::in_schema("DELETE", "iris"))
# Error: Can't unquote DELETE.iris
The third example in Schema selection article also doesn't work for me.
dbWriteTable(con, SQL("DELETE.iris"), iris)
# Error: Can't unquote DELETE.iris
Finally I found out a usage that works
dbWriteTable(con, name = DBI::Id(schema="DELETE", name="iris"), iris)
dbRemoveTable(con, name = DBI::Id(schema="DELETE", name="iris"), iris)
Is there something wrong with my setup? I think at least the Schema selection article should mention the DBI::Id method. I only incidentally found this through reading an issue discussion in github.