Fetching data from Oracle to query Table

拜拜、爱过 提交于 2019-12-12 01:37:02

问题


I am trying to fetch a query to extract data from an Oracle Database, but get an error message when trying to produce the final data frame to work on.

packages already installed

library(ROracle)
library(RODBC)

create the connection to the database

con<-dbConnect(Oracle(), username='xxxx', password='xxxx', dbname='xxxx')

query the data

query<- dbSendQuery(con,"select * from table")

execute query and return results in object of type dataframe

result<- fetch(query)

Everything works fine till the last line, where I want to fetch the query:

Error message is:

Error in .valueClassTest(ans, "data.frame", "fetch") : invalid value from generic function ‘fetch’, class “try-error”, expected “data.frame”

I couldn't find any proper explanation for solving this problem. Any idea ?

来源:https://stackoverflow.com/questions/34762144/fetching-data-from-oracle-to-query-table

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