RODBC connectivity to Oracle without tnsnames.ora

大憨熊 提交于 2019-12-05 23:07:55
Adrian Alanis

The correct sysntaxis you are looking for is

Conex     <- odbcDriverConnect("DRIVER=Oracle en OraClient11g_home2;UID=USERNAME;PWD=PASSWORD;DBQ=//HOSTNAME:PORT/ORACLE_SID;",
             believeNRows = FALSE)

Ex

Conex     <- odbcDriverConnect("DRIVER=Oracle en OraClient11g_home2;UID=John;PWD=Deere;DBQ=//fcoracleserver.youdomain:1521/TestEnvironment;",
             believeNRows = FALSE)

The hard part is to find the name of the Driver, as you can see mine is on spanish.

What I did is I create first a ODBC Conection using the C:\Windows\System32\odbcad32.exe, there you can check the right name of your Oracle or SQL Server driver.

Once you create the conection, you can use odbcDataSources() on R, to see that conection and to find out the driver. Thats really the hard part.

Hope it helps !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!