Error previewing SQL query

Using ODBC connection to oracle server. I can query the data fine using dplyr. When I try to preview a query using the SQL script I get the following error:

"Error in new_result(connection@ptr, statement) :
nanodbc/nanodbc.cpp:1344: HY090: [Microsoft][ODBC Driver Manager] Invalid string or buffer length"

In case like this, I would try to identify where the issue comes from. R or SQL.

Does the SQL script work outside of RStudio ? Without dplyr I mean, if you query directly using ODBC driver.

Also, if possible you could try ROracle, it works with the OCI driver not odbc and in the past I found some difference on very specific data type in our DB.

It just some wild guesses as you did not provide much information to help us help you. I would be great if you manage to build an example and show whet you've tried. Just showing an error message if often not enough. Thanks!

FAQ helper: FAQ: Tips for writing R-related questions

1 Like

Make sure that comment section in SQL code correctly connects to required SQL server. Default settings for SQL preview are different from what you have used in your r code

1 Like

Thanks for the feedback. I thought I had the comments section originally correct but ended up tweaking it a little more which fixed the issue.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.