Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 530
Jelle Jansen Avatar asked Dec 27 '25 19:12

Jelle Jansen


1 Answers

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
like image 115
Fippo Avatar answered Dec 30 '25 13:12

Fippo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!