| setDataMappings {RSQLite} | R Documentation |
Sets one or more conversion functions to handle the translation of SQL data types to R/S objects. This is only needed for non-primitive data, since all RS-DBI drivers handle the common base types (integers, numeric, strings, etc.)
setDataMappings(res, ...)
res |
a dbResultSet object as returned by dbExecStatement.
|
flds |
a field description object as returned by getFields.
|
... |
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.
dbExecStatement
dbExec
fetch
getFields
makeImage <- function(x) {
.C("make_Image", as.integer(x), length(x))
}
rs <- dbExecStatement(con, sql.query)
flds <- getFields(rs)
flds[3, "Sclass"] <- makeImage
setDataMappings(rs, flds)
im <- fetch(rs, n = -1)