Hello,
I am connecting R to a libreoffice-generated database (.odb) using the
ODB package.
I would like to link a dataframe to a specific table, but I cannot
manage to extract a given table:
```
> db =  odb.open(".../LOdatabase.odb", jarFile = NULL)
> odb.tables(db)
$demographic
field.name field.type data.type     name                  comment
1          ID    INTEGER   numeric       ID Unique identifier (auto)
2    Study_ID    INTEGER   numeric Study_ID            link to STUDY
[...]
> sqlQuery = "FROM TABLE demographic SELECT ALL"
> odb.read(db, sqlQuery, stringsAsFactors = FALSE, check.names = FALSE,
+ encode = TRUE, autoLogical = TRUE)
Error: Error while executing SQL query  : "Unable to retrieve JDBC result set
  JDBC ERROR: Unexpected token: FROM in statement [FROM]
  Statement: FROM TABLE demographic SELECT ALL"
> sqlQuery = "SELECT * FROM demographic"
> odb.read(db, sqlQuery, stringsAsFactors = FALSE, check.names = FALSE,
+ encode = TRUE, autoLogical = TRUE)
Error: Error while executing SQL query  : "Unable to retrieve JDBC result set
  JDBC ERROR: Table not found in statement [SELECT * FROM demographic]
  Statement: SELECT * FROM demographic"
> sqlQuery = "SELECT * FROM db$demographic"
> odb.read(db, sqlQuery, stringsAsFactors = FALSE, check.names = FALSE,
+ encode = TRUE, autoLogical = TRUE)
Error: Error while executing SQL query  : "Unable to retrieve JDBC result set
  JDBC ERROR: Table not found in statement [SELECT * FROM db$demographic]
  Statement: SELECT * FROM db$demographic"
```
What is the correct syntax?
Thank you

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to