Description Usage Arguments Value Note Author(s) Examples
Produces SQL queries describing the structure of the database and its content, and saves it to a file.
1 | odb.export(odb, file)
|
odb |
An |
file |
Path to the file in which export the SQL queries. |
Invisibly returns TRUE if succeeds, raises an error if not.
It is just a wrapper for the "SCRIPT '[file]'" SQL query, as implemented in HSQLDB.
Column comments and queries won't be exported, as they are not stored in the HSQL database.
Sylvain Mareschal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # 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"))
# Export to a file
sqlFile <- tempfile(fileext=".odb")
odb.export(odb, sqlFile)
# Writes to the file and closes the connection
odb.close(odb, write=TRUE)
|
Loading required package: DBI
Loading required package: RJDBC
Loading required package: rJava
Execution : 1/1 (ETA: 00:00:00)
Execution : 1/3 (ETA: 00:00:00.014)2/3 (ETA: 00:00:00.009)3/3 (ETA: 00:00:00)
Execution : 1/1 (ETA: 00:00:00)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.