odb.close {ODB} | R Documentation |
Closes an "ODB" connection and updates the .odb file
Description
Closes the connection to the embedded HSQLDB, removing temporary files and updating the .odb file if asked to do so.
Usage
odb.close(odb, write = TRUE)
Arguments
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. |
Value
Invisibly returns TRUE if succeeds, raises an error if not.
Note
To take data in a first file and save it in an other, copy the file before using odb.open
.
Author(s)
Sylvain Mareschal
See Also
Examples
# 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)
[Package ODB version 1.2.1 Index]