Oracle odbc connection not working #3893
Replies: 6 comments 5 replies
-
As a random guess, is it possible that in Positron you end up using a different version of R than what is being used in RStudio? Check with |
Beta Was this translation helpful? Give feedback.
-
Does this work for you? If so can you please provide a more complete reprex of the code you are running? library(DBI)
library(duckdb)
library(dbplyr)
library(dplyr)
con <- dbConnect(duckdb::duckdb())
dbWriteTable(con, "cars", mtcars)
tbl(con, "cars") |
Beta Was this translation helpful? Give feedback.
-
Sure thing:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the additional info, @crazybilly. Is that Oracle connections are sensitive to a few environmental variables, and I wonder if a change in envvars might be responsible for an unintended switch in driver or a dependency. (On MacOS, at least, I see a different Also, generally, the 12.02.0010 driver is quite dated. Is it possible for you to update your Instant Client to a more recent version? |
Beta Was this translation helpful? Give feedback.
-
That's the
l experimented with upgrading my Oracle driver a little bit--I created a new odbc connection using the v19 driver (which I already had installed on my machine, apparently!). I get the same behavior as before when use that driver: RStudio seems fine, but Positron can't create a I see that v23 is out nowadays! I'll see if I can download/install that and give a go soon. |
Beta Was this translation helpful? Give feedback.
-
A quick note: I installed Positron version 2024.08.0 build 31 this morning, and now everything is working fine!! The very things that triggered the problem before are returning data (rather than errors) as expected! Thanks for all your work on this! |
Beta Was this translation helpful? Give feedback.
-
I have traditionally connected to our local data warehouse with some code like this:
con <- DBI::dbConnect(odbc::odbc(), "MY_ODBC_CON_NAME", uid = Sys.getenv('MY_USER_NAME'), pwd = Sys.getenv("MY_PASS"), timeout = 10)
When I do this in RStudio, everything works fine: I can use
tbl()
to create & query tables, connect/disconnect as needed, etc.When I try this in Positron, though, things don't work as expected. The initial connection seems to execute without errors, but when I try to execute any DBI commands against con, I get an error like:
Even
DBI::dbDisconnect(con)
gives me:There's a very real possibility, of course, that I'm doing something wrong, or something specific in our Oracle implementation (or my Windows-based odbc connnection), but I'd lean further that direction is the same code didn't work so well in RStudio. Maybe there's more I can do to help track it all down?
Beta Was this translation helpful? Give feedback.
All reactions