dbSetDataMappings {DBI} | R Documentation |
Sets one or more conversion functions to handle the translation of DBMS data types to R/Splus objects. This is only needed for non-primitive data, since all DBI drivers handle the common base types (integers, numeric, strings, etc.)
dbSetDataMappings(res, flds, ...)
res |
a DBIResult object as returned by dbSendQuery .
|
flds |
a field description object as returned by dbColumnInfo .
|
... |
any additional arguments are passed to the implementing method. |
The details on conversion functions (e.g., arguments, whether they can invoke initializers and/or destructors) have not been specified.
a logical specifying whether the conversion functions were successfully installed or not.
Conversion functions are set up to be invoked for each element of the corresponding fields in the result set.
No driver has yet implemented this functionality.
See the Database Interface definition document
DBI.pdf
in the base directory of this package
or http://developer.r-project.org/db.
dbSendQuery
,
fetch
,
dbColumnInfo
.
## Not run: makeImage <- function(x) { .C("make_Image", as.integer(x), length(x)) } res <- dbSendQuery(con, statement) flds <- dbColumnInfo(res) flds[3, "Sclass"] <- makeImage dbSetDataMappings(rs, flds) im <- fetch(rs, n = -1) ## End(Not run)