0

Despite several efforts I do not succeed to read my tables in an open office database in R.

I have loaded the ODB package. And connect using the command

con <- odb.open('Database.odb')

to connect when i use the command

odb.tables(con)

The console shows me the following

$Datasets
    field.name field.type data.type comment
1           ID    INTEGER   numeric    <NA>
2 Dataset_naam    VARCHAR character    <NA>
3 Beschrijving    VARCHAR character    <NA>
4     Eigenaar    VARCHAR character    <NA>
5      Cluster       CHAR character    <NA>
6   Vindplaats    VARCHAR character    <NA>

Looks promising, however when I try to actually acces the table like this

odb.read(con, 'SELECT * FROM Datasets')

the following error is thrown.

Error: Error while executing SQL query  : "Unable to retrieve JDBC `result set for SELECT * FROM Datasets (Table not found in statement [SELECT * FROM Datasets])"`

Why can I not acces the table?

On the other hand if I try to create tables They do not show when I open the open office database.

Any advise would be greatly appreciated.

4

2 回答 2

1

你必须写一个表的名字。尝试以下操作:

odb.read(con, 'SELECT * FROM Cluster')

于 2019-04-14T18:54:27.113 回答
0

你应该试试这个...

print(odb.read(con, "SELECT * FROM Datasets"))
于 2019-11-12T11:50:32.193 回答