dbj-sql-generate: Generate SQL statements

Description Usage Arguments Value See Also

Description

These functions use the driver's sql_dialect environment to generate SQL statments for creating tables and inserting data.

Usage

1
2
3
4
5
6
7
## S4 method for signature 'JDBCConnection'
sqlCreateTable(con, table, fields, row.names = NA,
  temporary = FALSE, ...)

## S4 method for signature 'JDBCConnection'
sqlAppendTable(con, table, values, row.names = NA,
  ...)

Arguments

con

A database connection.

table

Name of the table. Escaped with dbQuoteIdentifier.

fields

Either a character vector or a data frame.

A named character vector: Names are column names, values are types. Names are escaped with dbQuoteIdentifier. Field types are unescaped.

A data frame: field types are generated using dbDataType.

row.names

Either TRUE, FALSE, NA or a string.

If TRUE, always translate row names to a column called "row_names". If FALSE, never translate row names. If NA, translate rownames only if they're a character vector.

A string is equivalent to TRUE, but allows you to override the default name.

For backward compatibility, NULL is equivalent to FALSE.

temporary

If TRUE, will generate a temporary table statement.

...

Other arguments used by individual methods.

values

A data frame. Factors will be converted to character vectors. Character vectors will be escaped with dbQuoteString.

Value

an SQL object

See Also

Other JDBCConnection methods: dbConnect,JDBCConnection-method, dbDisconnect,JDBCConnection-method, dbSendQuery,JDBCConnection,character-method, dbj-edit-tables, dbj-sql-quote, dbj-table

Other SQL dialect functions: dbj-sql-quote, sql_dialect

Other SQL functions: dbj-sql-quote


hoesler/dbj documentation built on May 17, 2019, 4:36 p.m.