query_database: query_database helper function

Description Usage Arguments Value Examples

View source: R/query_database.R

Description

Internal function to query the database. The function sends a sql statement to the database and returns a data.table.

Usage

1
query_database(db_con, sql_statement)

Arguments

db_con

A DBI database connection.

sql_statement

A character string containing a valid SQL statement.

Value

Returns the result of the db-query.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
db_con <- DIZutils::db_connection(
  db_name = "i2b2",
  db_type = "postgres"
)

query_database(
  db_con = db_con,
  sql_statement = "SELECT * FROM table_name;"
)
## End(Not run)

miracum/misc-dizutils documentation built on Nov. 21, 2020, 7:41 p.m.