Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbReadTable not working after DBI 0.6 #171

Closed
zhiyzuo opened this issue Mar 31, 2017 · 1 comment
Closed

dbReadTable not working after DBI 0.6 #171

zhiyzuo opened this issue Mar 31, 2017 · 1 comment

Comments

@zhiyzuo
Copy link

zhiyzuo commented Mar 31, 2017

When I upgrade DBI from 0.5.1 to 0.6, whenever I call dbReadTable (dbGetQuery is fine):

driver = JDBC("oracle.jdbc.OracleDriver", classPath = class_path)n
conn = dbConnect(driver, 
           myhost, 
           username, password)

mv = dbReadTable(conn, "MOVIES")

Such error will occur:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for functiondbGetQueryfor signature"character", "missing"Traceback:

1. dbReadTable(conn, SQL("MOVIES"))
2. dbReadTable(conn, SQL("MOVIES"))
3. .local(conn, name, ...)
4. dbGetQuery(paste0("SELECT * FROM ", sql_name))
5. (function (classes, fdef, mtable) 
 . {
 .     methods <- .findInheritedMethods(classes, fdef, mtable)
 .     if (length(methods) == 1L) 
 .         return(methods[[1L]])
 .     else if (length(methods) == 0L) {
 .         cnames <- paste0("\"", vapply(classes, as.character, 
 .             ""), "\"", collapse = ", ")
 .         stop(gettextf("unable to find an inherited method for function %s for signature %s", 
 .             sQuote(fdef@generic), sQuote(cnames)), domain = NA)
 .     }
 .     else stop("Internal error in finding inherited methods; didn't return a unique method", 
 .         domain = NA)
 . })(list("character", structure("missing", package = "methods")), 
 .     structure(function (conn, statement, ...) 
 .     standardGeneric("dbGetQuery"), generic = structure("dbGetQuery", package = "DBI"), package = "DBI", group = list(), valueClass = character(0), signature = c("conn", 
 .     "statement"), default = `\001NULL\001`, skeleton = (function (conn, 
 .         statement, ...) 
 .     stop("invalid call in method dispatch to 'dbGetQuery' (no default method)", 
 .         domain = NA))(conn, statement, ...), class = structure("standardGeneric", package = "methods")), 
 .     <environment>)
6. stop(gettextf("unable to find an inherited method for function %s for signature %s", 
 .     sQuote(fdef@generic), sQuote(cnames)), domain = NA)

DBI 0.5.1 is fine for both read table and get query functions.

@krlmlr
Copy link
Member

krlmlr commented Apr 1, 2017

Related: s-u/RJDBC#40

@krlmlr krlmlr closed this as completed in 75dda31 Apr 1, 2017
krlmlr added a commit that referenced this issue Apr 2, 2017
- Fix `dbReadTable()` for backends that do not provide their own implementation (#171).
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants