Learn R Programming

SciencesPo (version 1.3.9)

dbTempTable: Creates a temporary table in the database

Description

This function is useful if most of your work is on a subset of the database

Usage

dbTempTable(db, tab_name, query)

Arguments

db
a database connection object
tab_name
character name for the teporary table
query
character the query that specifies the temporary table

Details

The table will exist for as long as the database connection is kept open The Select_query argument will take the output from a select_events(sql_only = TRUE) based function

Examples

Run this code
db <- database("Eleicoes")
dbTempTable(db, tab_name = "gerais_2006",
           query = select_events(db, tab = "Candidatos",
           columns = c("nome", "resultado", "partido"),
           where = "data > '1997-01-01'",
           sql_only = TRUE))

Run the code above in your browser using DataLab