Description Usage Arguments DBI-backends Examples
Exposes interface to simple CREATE TABLE
commands. The default
method is ANSI SQL 99 compliant.
1 2 3 4 5 | sqlTableCreate(con, table, fields, row.names = NA, temporary = FALSE, ...)
## S4 method for signature 'DBIConnection'
sqlTableCreate(con, table, fields, row.names = NA,
temporary = FALSE...)
|
con |
A database connection. |
table |
Name of the table. Escaped with
|
fields |
Either a character vector or a data frame. A named character vector: Names are column names, values are types.
Names are escaped with A data frame: field types are generated using
|
row.names |
Either If A string is equivalent to For backward compatibility, |
temporary |
If |
... |
Other arguments used by individual methods. |
If you implement one method (i.e. for strings or data frames), you need to implement both, otherwise the S4 dispatch rules will be ambiguous and will generate an error on every call.
1 2 3 4 5 6 | sqlTableCreate(ANSI(), "my-table", c(a = "integer", b = "text"))
sqlTableCreate(ANSI(), "my-table", iris)
# By default, character row names are converted to a row_names colum
sqlTableCreate(ANSI(), "mtcars", mtcars[, 1:5])
sqlTableCreate(ANSI(), "mtcars", mtcars[, 1:5], row.names = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.