Retrieving data from Oracle to query a table

I am trying to retrieve a query to retrieve data from an Oracle database, but I get an error when trying to create a final data frame for work.

already installed packages

library(ROracle)
library(RODBC)

create database connection

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

request data

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

execute the query and return the results to an object of type dataframe

result<- fetch(query)

Everything works fine until the last line where I want to get the request:

Error message:

Error in .valueClassTest (ans, "data.frame", "fetch"): invalid value from the generic function 'fetch, class "try-error", expected "Data.frame"

I could not find the right explanation to solve this problem. Any idea?

0
source share

Source: https://habr.com/ru/post/1629525/


All Articles