Вопрос

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 typeInfo". And no examples for this arguments. Where can I find a better explanation?

Это было полезно?

Решение

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

> 

Другие советы

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 ...
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top