odb.close {ODB} | R Documentation |
Closes the connection to the embedded HSQLDB, removing temporary files and updating the .odb file if asked to do so.
odb.close(odb, write = TRUE)
odb |
|
write |
Single logical value, defining if the modifications has to be saved in the original .odb file or not. Notice they will be definitively lost if closing with write=FALSE. |
Invisibly returns TRUE if succeeds, raises an error if not.
To take data in a first file and save it in an other, copy the file before using odb.open
.
Sylvain Mareschal
# New empty .odb file
odbFile <- tempfile(fileext=".odb")
odb.create(odbFile, overwrite="do")
odb <- odb.open(odbFile)
# New table
odb.write(odb, "CREATE TABLE fruits (name VARCHAR(6) PRIMARY KEY)")
odb.insert(odb, "fruits", c("banana", "pear", "peach"))
# Writes to the file and closes the connection
odb.close(odb, write=TRUE)