Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect translation of dates with Oracle ODBC. #1468

Open
edonnachie opened this issue Feb 27, 2024 · 1 comment
Open

Incorrect translation of dates with Oracle ODBC. #1468

edonnachie opened this issue Feb 27, 2024 · 1 comment

Comments

@edonnachie
Copy link

When translating a date to SQL with an ODBC connection to an Oracle database, dbplyr returns SQL of the form "DATE 2024-02-27". This is incorrect and leads to the error "Failed to collect lazy table".

dbplyr should should translate o valid Oracle SQL of the form to_date('2024-2-07', 'YYYY-MM-DD')

This problem did not arise when using the ROracle package, which I, like Oracle, have now all but abandoned.

Example;
With db as an odbc connection to an Oracle database (Formal class 'Oracle' [package "odbc"]:

 dbplyr::translate_sql(X > as.Date("2024-01-01"), con=db)
# Returns: <SQL> "X" > DATE 2024-01-01
@Thranholm
Copy link

I had a similar problem, the issue is fixed in #1389 and in the dev-version of the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants