[R] ODBC database access package

Michael Lapsley
1999-10-16T20:56:34Z

I have just finished a first rough cut of RODBC,
a database connectivity addon.  In theory it should allow
access to any odbc compliant database for which the driver
set is installed.  On unix this includes MySQL, mSQL and
postgres using the unixODBC set.
On windows it should include access, sqlserver etc
if the odbc drivers are installed.

For those who have never taken an interest in this, Open DataBase
Connectivity (I think) is an api championed by (Oh dear!) microsoft
as a lowest common denominator set of standardised functions for transferring
data between SQL databases and applications.  To use it one needs a driver
manager, provided
in the odbc library, and a driver provided for/by the specific database engine.
A DSN (data source name) is then defined by the user as the object of the
odbc application's attention.  This defines an alias by which the connection
is
known, the database driver and the database.  The function set is fairly rich,
and I have not implemented many of them.  Most functionality can be accessed
via select statements anyway, at the cost perhaps of portability.

The package implements low level odbc R functions which are
basically wrappers for the C odbc api calls, together with
a set of higher level commands based on the concept of moving data
between dataframes and sql tables with a single command as much as
possible.  For example sqlSave(0,dataframe) will save the dataframe
to a table of the same name, creating or modifying it as necessary.

All of the functions _SEEM_ to work except one (sqlCopy), where I
cannot resolve a problem with propagating substitute()ed names down a
function tree.  This is only a convenience function and is not strictly
necessary.  The rest seem to work OK, but I would appreciate any suggestions
for improved robustness, bug fixes, or improvements.

I need a volunteer to compile this for windows and see if it works.  I believe
from microsoft.com that VC++ comes with an odbc library:  can someone please
help?

The files are on www.ndirect.co.uk/~mlapsley as RODBC-0.1a.[tgz | zip]
If people have had a look and and think it merits a place on CRAN then I will
submit a version with any bugs found ironed out.

Thanks to the folk who answered some of the questions about problems I had
writing this.  It is my first attempt at reusable R code and I hope it does not
look too amateurish!

Michael
----------------------------------
E-Mail: Michael Lapsley <mlapsley at ndirect.co.uk>
Date: 16-Oct-99
Time: 17:29:31

This message was sent by XFMail
----------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._