Changes between Version 6 and Version 7 of Cookbook ODBC


Ignore:
Timestamp:
Jan 23, 2010 3:28:18 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Cookbook ODBC

    v6 v7  
    1111[[BR]][[BR]][[Image(source:EDA/data/Docs/trac/RODBC.jpg)]][[BR]][[BR]] 
    1212[[Image(source:EDA/data/Docs/trac/RODBC2.jpg)]][[BR]][[BR]] 
    13 the Data Source name will indicate your ODBC connection used in R (the one used in the xml file) 
     13The '''Data Source''' name will indicate your '''ODBC connection''' used in R (in the xml file as shown below). 
    1414Test your connector, it should return connection successfull. If not check that your port is 5432 (it can be different if you have installled several postgres servers). 
    1515Check also that your usernames and passwords are correct. 
     
    3535Load init.r 
    3636''note : you are supposed to put the xml file where the R program can directly load it. In the case of EDA you will be at the root of the EDA project. In Eclipse, a variable working directory allows to start R directly at the right location.'' 
     37to test your connection write 
     38{{{ 
     39library(RODBC) 
     40odbcConnect(dsn=baseODBC[1],uid=baseODBC[2],pwd=baseODBC[3]) 
     41> RODBC Connection 4 
     42> Details: 
     43> case=tolower 
     44> ... 
     45}}} 
     46The possible commands for RODBC are 
     47{{{ 
     48help.search("ODBC") #returns the following 
     49RODBC::odbcUpdate       Internal RODBC functions 
     50RODBC::RODBC            ODBC Database Connectivity 
     51RODBC::odbcQuery        Low-level ODBC functions 
     52RODBC::odbcClose        ODBC Close Connections 
     53RODBC::odbcConnect      ODBC Open Connections 
     54RODBC::odbcDataSources 
     55                        List ODBC Data Sources 
     56RODBC::odbcGetInfo      Request Information on an ODBC Connection 
     57RODBC::odbcSetAutoCommit 
     58                        ODBC Set Auto-Commit Mode 
     59RODBC::sqlPrimaryKeys   Query Column Structure in ODBC Tables 
     60RODBC::sqlCopy          ODBC Copy 
     61RODBC::sqlDrop          Deletion Operations on Tables in ODBC databases 
     62RODBC::sqlFetch         Reading Tables from ODBC Databases 
     63RODBC::sqlQuery         Query an ODBC Database 
     64RODBC::sqlSave          Write a Data Frame to a Table in an ODBC 
     65                        Database 
     66RODBC::sqlTables        List Tables on an ODBC Connection 
     67RODBC::sqlTypeInfo      Request Information about Data Types in an ODBC 
     68}}} 
    3769 
    3870