Learn R Programming

RODBC (version 1.2-2)

setSqlTypeInfo: Specify a Mapping of R Types to DBMS Types

Description

Specify or retrieve a mapping of Rtypes to DBMS datatypes.

Usage

setSqlTypeInfo(driver, value)

getSqlTypeInfo(driver)

Arguments

driver
A character string specifying the driver as returned by odbcGetInfo. Optional for getSqlTypeInfo.
value
A named list with character values. This should have names "double", "integer", "character" and "logical".

Value

  • For setSqlTypeInfo none.

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

Details

This information is used by sqlSave if it creates a table in the DBMS.

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

See Also

sqlTypeInfo, sqlSave.

Examples

Run this code
getSqlTypeInfo()
getSqlTypeInfo("MySQL")
setSqlTypeInfo("SQLServer",
               list(double="float", integer="int",
                    character="varchar(255)", logical="varchar(5)"))

Run the code above in your browser using DataLab