Description Usage Arguments Value Author(s) See Also Examples
Gets description of every tables in the database through an "odb" connection : table names, column names, column SQL and R types.
1 | odb.tables(odb)
|
odb |
An |
Returns a named list, whith an element for every table in the database. Data.frames are returned by dbColumnInfo
, updated with comments returned by odb.comments
.
Sylvain Mareschal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.