Hi All, I want to join a table (Dataset) that is created in R with a table that is in oracle database. Can some one help me in accomplishing this task in R? Example Code: library(RODBC) DB_CONNECT <- odbcConnect("DSN_NAME") TABLE_JOIN <- sqlQuery(DB_CONNECT, "SELECT * FROM DB_TABLE WHERE COL_1 NOT IN (SELECT COL_1 FROM DATA_SET_R) ") Regards, Madana -- View this message in context: http://r.789695.n4.nabble.com/Joining-R-Local-Dataset-with-Table-from-Database-tp4638967.html Sent from the R help mailing list archive at Nabble.com.
R. Michael Weylandt
2012-Aug-02 22:50 UTC
[R] Joining R Local Dataset with Table from Database
You'll either need to do it in R or Oracle (I'm not sure you can do it directly across the ODBC boundary) -- I'd actually think Oracle would be more performant for this sort of thing. But anyways, import your data from Oracle into R as a data.frame and then look at the ?merge command. Best, Michael On Thu, Aug 2, 2012 at 4:58 PM, Madana_Babu <madana_babu at infosys.com> wrote:> Hi All, > > I want to join a table (Dataset) that is created in R with a table that is > in oracle database. Can some one help me in accomplishing this task in R? > > Example Code: > > library(RODBC) > DB_CONNECT <- odbcConnect("DSN_NAME") > > TABLE_JOIN <- sqlQuery(DB_CONNECT, "SELECT * FROM DB_TABLE WHERE COL_1 NOT > IN (SELECT COL_1 FROM DATA_SET_R) ") > > Regards, > Madana > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Joining-R-Local-Dataset-with-Table-from-Database-tp4638967.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.