temp_table: Creates a temporary table in the database

Description Usage Arguments Details Examples

Description

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

Usage

1
temp_table(db, tab_name, select_query)

Arguments

db

a database connection object

tab_name

character name for the teporary table

select_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

1
2
3
4
5
6
7
8
9
## Not run: 
db <- database("myCPRDdb")
temp_table(db, tab_name = "post_2005", 
           select_query = select_events(db, tab = "Referral", 
                                        columns = c("patid", "eventdate", "medcode"), 
                                        where = "eventdate > '2005-01-01'",
                                        sql_only = TRUE))

## End(Not run)

rEHR documentation built on Jan. 23, 2017, 1 p.m.

Related to temp_table in rEHR...