开发者

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

> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜