setSqlTypeInfo: Specify or Query a Mapping of R Types to DBMS Types

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/TypeInfo.R

Description

Specify or retrieve a mapping of R types to DBMS datatypes.

Usage

1
2
3
setSqlTypeInfo(driver, value)

getSqlTypeInfo(driver)

Arguments

driver

A character string specifying the DBMS_name as returned by odbcGetInfo. Optional for getSqlTypeInfo.

value

A named list with character values. This should have names "double", "integer", "character" and "logical", and values SQL types appropriate to the DBMS.

Details

This information is used by sqlSave if it creates a table in the DBMS and is not overridden by arguments typeInfo or varTypes. Mappings are included for MySQL, PostgreSQL, SQLite, Oracle, Mimer, DB2 on Windows, and the Microsoft SQL Server, Access, Excel and Dbase drivers.

The SQL types chosen should be nullable to allow NAs to be represented. (Bit and boolean types often are not.)

Value

For setSqlTypeInfo none.

For getSqlTypeInfo with an argument, a named list. Without an argument, a data frame.

Author(s)

Brian Ripley

See Also

sqlTypeInfo, sqlSave.

Examples

1
2
3
4
5
6
7
8
## Not run: 
getSqlTypeInfo()
getSqlTypeInfo("MySQL")
setSqlTypeInfo("Microsoft SQL Server",
               list(double="float", integer="int",
                    character="varchar(255)", logical="varchar(5)"))

## End(Not run)

RODBC documentation built on May 30, 2017, 5:12 a.m.