setDataMappings {RSQLite}R Documentation

Set data mappings between an RDBMS and R/S

Description

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.)

Usage

setDataMappings(res, ...)

Arguments

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.

Details

The details on conversion functions (e.g., arguments, whether they can invoke initializers and/or destructors) have not been specified.

Value

a logical specifying whether the conversion functions were successfully installed or not.

Side Effects

Conversion functions are set up to be invoked for each element of the corresponding fields in the result set.

Note

No driver has yet implemented this functionality.

See Also

dbExecStatement dbExec fetch getFields

Examples

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)


[Package Contents]