简体   繁体   中英

Connection to Oracle database since upgrade dbplyr not working

I am trying to connect to an Oracle database with dplyr and dbplyr backend. However since the upgrade of dbplyr to version 2.0.0 it no longer works and getting the following error.

x <- tbl(con, in_schema("dm", "DM_CLT_POS_OVL_LIAB_HEDGE"))

Error in.oci.GetQuery(conn, statement, data = data, prefetch = prefetch, : ORA-00942: table or view does not exist

In the previous version of dbplyr I could make it work with the redirection functions ( see below) but they have been removed with the upgrade.

#below are required to make the translation done by dbplyr to SQL produce working Oracle 
SQLsql_translate_env.OraConnection <- dbplyr:::sql_translate_env.Oracle
sql_select.OraConnection <- dbplyr:::sql_select.Oracle
sql_subquery.OraConnection <- dbplyr:::sql_subquery.Oracle

Any help would be appreciated.

Came across the same issue using RJDBC package instead of an ODBC driver based approach and found the solution for it on the github page of dbplyr .

I'm not sure, whether it works and cannot try it myself but you might try to replace your assignments with these here:

SQLsql_translate_env.OraConnection <- dbplyr:::sql_translation.Oracle
sql_select.OraConnection <- dbplyr:::sql_query_select.Oracle
sql_subquery.OraConnection <- dbplyr:::sql_query_wrap.Oracle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM