Search code examples
rrstudiodrivernetezzarodbc

Connecting R studio to IBM Netezza database using ODBC connection


I need to connect to Netezza DB through R studio. I checked some pages already, the answers weren't clear. I don't know much about ODBC drivers and stuffs.

I have this folder that has bunch of dll and .jar files.

C:\Program Files (x86)\IBM Netezza ODBC Driver\jre.

Do i have to download any drivers and are there any specific R packages to install for this.


Solution

  • I did this with RODBC package.

    First, make sure ODBC connection is set up in ODBC Data source Administrator(Windows system).

    Install RODBC package in R studio.
    library(RODBC)
    myconn <-odbcConnect("ODBC_connection_name", uid="user", pwd="pass")
    q_df <- sqlQuery(myconn,"select * from table", believeNRows=FALSE)

    By default only 256 rows is imported. Set believeNRows=FALSE will import all the rows