RODBC sqlSave column types: how determined?
I'm trying to understand how RODBC determines the column types of a newly created (Access) table? The R documentation of sqlSave is very cryptic: "types are selected by consulting arguments varTypes and ty开发者_开发技巧peInfo". And no examples for this arguments. Where can I find a better explanation?
Just look at the sources of the RODBC package.
# from R/TypeInfo.R:
typesR2DBMS <-
list(MySQL = list(double="double", integer="integer",
character="varchar(255)", logical="varchar(5)"),
ACCESS = list(double="DOUBLE", integer="INTEGER",
character="VARCHAR(255)", logical="varchar(5)"),
# etc ...
No need to look at the sources. Use "getSqlTypeInfo(driver)" instead.
> getSqlTypeInfo("ACCESS")
$double
[1] "DOUBLE"
$integer
[1] "INTEGER"
$character
[1] "VARCHAR(255)"
$logical
[1] "varchar(5)"
>
精彩评论