No RStudio SQL Error Messages

I was considering switching to RStudio as my main DBMS, but whenever a query has a problem there's no error message indicated what went wrong. I wanted to know if there's a way to enable this, or if its an issue RStudio may be looking into.

I'm not sure it's advisable to use the RStudio IDE as a full database management system, but it's certainly a popular tool to connect & query most types of databases.

Your queries should be returning messages. The IDE also has the connections pane, which makes it possible to easily connect to a variety of data sources, and explore the objects and data inside the connection.

https://db.rstudio.com/databases/


It'd probably be helpful to have a clearer sense of what you're trying to do, and what happens when you try. E.g. via a minimal reproducible example.

Sorry, I wrote this post from memory and missed some important details. I can't share a minimal reproducible example of the actual data, and can't seem to produce it with a toy sqlite db. My problem exists when using a fairly complicated SQL Server database.

There's isn't a problem running queries using just SQL, i.e initializing a con from the Connections tab, creating a file with "--preview conn=CON" at the top, pasting a query in there, and pressing "Preview". If I create an error - a leading comma after the last column in a SELECT statement, for example- the popup shows a helpful error similar to the one I'd get in a DBMS like dbeaver or Azure Data Studio.

DIAGNOSTIC_INFO Incorrect syntax near the keyword 'FROM'

The problem arises when I try to read in a query with R. For example:

df = DBI::dbGetQuery(con, statement = read_file("query.sql"))

The same leading comma throw an error but there's no error message.

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