dbDataType: Determine the SQL data type of an object.
Description
This is a generic function. The default method determines the SQL type of an
R object according to the SQL 92 specification, which may serve as a starting
point for driver implementations. The default method also provides a method
for data.frame which will return a character vector giving the type for each
column in the dataframe.
Usage
dbDataType(dbObj, obj, ...)
Arguments
dbObj
A object inheriting from DBIDriver
obj
An R object whose SQL type we want to determine.
...
Other arguments passed on to methods.
Value
A character string specifying the SQL data type for obj.
Details
The data types supported by databases are different than the data types in R,
but the mapping between the primitve types is straightforward: Any of the
many fixed and varying length character types are mapped to character
vectors. Fixed-precision (non-IEEE) numbers are mapped into either numeric or
integer vectors.
Notice that many DBMS do not follow IEEE arithmetic, so there are potential
problems with under/overflows and loss of precision.