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"))
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.
In your post you do not specify which DBMS are you having issues with - is it Postgres by chance?
I had issues with copying to a Postgres schema in the past that I was never able to truly solve. I ended up writing my data to a temporary table and flipping it over to its proper place by executing a piece of SQL code directly.
A suboptimal solution, but it got the job done (eventually).
Thanks for the reminder, I added database information in original post (IBM DB2). I thought it's relative irrelevant since odbc/DBI is standard interface (but dbplyr probably do depend on backend support).
I am not sure, as I solved the problem via a workaround when it was pressing, and now I don't have time to test it again - but I will keep the idea in mind for the future.
By the way good luck working with DB2, I still get shivers when remembering the short time I was forced to use the technology