# NOT RUN {
# New empty .odb file
odbFile <- tempfile(fileext=".odb")
odb.create(odbFile, overwrite="do")
odb <- odb.open(odbFile)
# New tables
SQL <- c(
"CREATE TABLE fruits (
name VARCHAR(6) PRIMARY KEY,
color VARCHAR(32)
)",
"CREATE TABLE vegetables (
name VARCHAR(6) PRIMARY KEY,
color VARCHAR(32)
)"
)
odb.write(odb, SQL)
# Print tables
print(odb.tables(odb))
# Writes to the file and closes the connection
odb.close(odb, write=TRUE)
# }
Run the code above in your browser using DataLab