问题
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