You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(DBI)
con<- dbConnect(odbc::odbc(), dsn="zzz")
dbExecute(con, "create table test (x int)")
# [1] 0user<- dbGetQuery(con, "select user from dual")$USER# confirm that we can find the table:odbc::odbcListObjects(con, schema=user)
# name type# 1 TEST table
dbListTables(con)
# [1] "TEST"# make a synonym and show that it can't be found:
dbExecute(con, "create synonym test2 for test")
# [1] 0odbc::odbcListObjects(con, schema=user)
# name type# 1 TEST table
dbListTables(con)
# [1] "TEST"
However:
Showing synonyms in dbListTables() would be problematic in some cases. E.g. our database has many synonyms (>3500) so showing all synonyms would make dbListTables() useless. Maybe an argument synonyms = TRUE|FALSE could be use?
The issue discussed in #773 for SQL Server also applies to Oracle. So here is a separate issue as suggested by @simonpcouch.
In Oracle, synonyms are available in {ALL|USER}_SYNONYMS.
Same reprex as in #773 (comment):
However:
dbListTables()
would be problematic in some cases. E.g. our database has many synonyms (>3500) so showing all synonyms would makedbListTables()
useless. Maybe an argumentsynonyms = TRUE|FALSE
could be use?Database
Session Info
The text was updated successfully, but these errors were encountered: