Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mysqlBuildTableDefinition

Build the SQL CREATE TABLE definition as a string


Description

The output SQL statement is a simple CREATE TABLE with suitable for dbGetQuery

Usage

mysqlBuildTableDefinition(
  dbObj,
  name,
  obj,
  field.types = NULL,
  row.names = TRUE,
  ...
)

Arguments

dbObj

any DBI object (used only to dispatch according to the engine (e.g., MySQL, Oracle, PostgreSQL, SQLite)

name

name of the new SQL table

obj

an R object coerceable to data.frame for which we want to create a table

field.types

optional named list of the types for each field in obj

row.names

logical, should row.name of value be exported as a row\_names field? Default is TRUE

...

reserved for future use

Value

An SQL string


RMySQL

Database Interface and 'MySQL' Driver for R

v0.10.21
GPL-2
Authors
Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>), David James [aut], Saikat DebRoy [aut], Hadley Wickham [aut], Jeffrey Horner [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.