Skip to content

dbReadTable not working after DBI 0.6 #171

Description

@zhiyzuo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions