4

I am trying to run my R code, which worked perfectly fine two months ago but now crashes when I try to read some data of Teradata into R, in an sql-chunk. The error that shows up is the following:

Error in class(obj) <- "rs.scalar" : cannot set attribute on a symbol

I have no clue what is going on and why it does not work anymore. Anyone a clue?

Below my full R code:

```{r, include=FALSE}
library(RJDBC)
library(rstudioapi)

# Database Driver
drv <- JDBC(
  driverClass = getOption("teradata.driver"), 
  classPath = getOption("teradata.classpath")
)

# Database Connection
con <- dbConnect(
  drv, 
  url = getOption("teradata.dns"),
  user = getOption("teradata.user"),
  password = rstudioapi::askForPassword()
)
```

```{sql connection=con}
SELECT TOP 10 * FROM database.table
```

I am using R 3.5.0 and RJDBC packages is version 0.2-7.1.

Many thanks for your help!

Z117
  • 201
  • 3
  • 12

2 Answers2

2

Solved it. Seemed to be an error of RStudio itself (rs.scalar). Reinstalling RStudio solved the problem.

Z117
  • 201
  • 3
  • 12
0

Had the same issue, and discoverred that quoting the "con" solved the problem.

As in:

```{sql connection="con"}
SELECT TOP 10 * FROM database.table
```
dsz
  • 4,542
  • 39
  • 35