RODBC {RODBC}R Documentation

ODBC Database Connectivity

Description

RODBC implements ODBC database connectivity with compliant databases where drivers exist on the host system.

Details

Two groups of commands are provided. The mainly internal odbc* commands implement relatively low level access to the odbc functions of similar name. sql* commands are higher level constructs to read, save, copy and manipulate data between data frames and sql tables. Many connections can be open at once to any combination of dsn/hosts.

The functions try to cope with the peculiar way the Excel ODBC driver handles table names. However, SQL expects both table and column names to be alphanumeric plus _, and RODBC does not support vendor extensions. Most of the functions will drop other characters from table and column names.

options(dec) can be used to set the decimal point to be used when reading numbers from character data on the database: the default is taken from the current locale by Sys.localeconv.

Author(s)

Michael Lapsley and Brian Ripley

See Also

odbcConnect, sqlFetch, sqlSave, sqlTables, odbcGetInfo

Examples

## Not run: 
channel <- odbcConnect("test")
sqlSave(channel, USArrests, rownames = "State", verbose = TRUE)
sqlQuery(channel, paste("select State, Murder from USArrests",
                        "where Rape > 30 order by Murder"))
sqlFetch(channel, "USArrests", rownames = "State")
sqlDrop(channel, "USArrests")
close(channel)
## End(Not run)

[Package RODBC version 1.1-9 Index]