Description Usage Arguments Details Examples
Exposes an interface to simple CREATE TABLE
commands. The default
method is ANSI SQL 99 compliant.
This method is mostly useful for backend implementers.
1 |
con |
A database connection. |
table |
The table name, passed on to
|
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. |
The row.names
argument must be passed explicitly in order to avoid
a compatibility warning. The default will be changed in a later release.
1 2 3 4 5 6 | sqlCreateTable(ANSI(), "my-table", c(a = "integer", b = "text"))
sqlCreateTable(ANSI(), "my-table", iris)
# By default, character row names are converted to a row_names colum
sqlCreateTable(ANSI(), "mtcars", mtcars[, 1:5])
sqlCreateTable(ANSI(), "mtcars", mtcars[, 1:5], row.names = FALSE)
|
<SQL> CREATE TABLE "my-table" (
"a" integer,
"b" text
)
<SQL> CREATE TABLE "my-table" (
"Sepal.Length" DOUBLE,
"Sepal.Width" DOUBLE,
"Petal.Length" DOUBLE,
"Petal.Width" DOUBLE,
"Species" TEXT
)
<SQL> CREATE TABLE "mtcars" (
"row_names" TEXT,
"mpg" DOUBLE,
"cyl" DOUBLE,
"disp" DOUBLE,
"hp" DOUBLE,
"drat" DOUBLE
)
<SQL> CREATE TABLE "mtcars" (
"mpg" DOUBLE,
"cyl" DOUBLE,
"disp" DOUBLE,
"hp" DOUBLE,
"drat" DOUBLE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.