querySql: Retrieve data to a data.frame

Description Usage Arguments Details Value Examples

View source: R/HelperFunctions.R

Description

This function sends SQL to the server, and returns the results.

Usage

1

Arguments

connection

The connection to the database server.

sql

The SQL to be send.

Details

This function sends the SQL to the server and retrieves the results. If an error occurs during SQL execution, this error is written to a file to facilitate debugging.

Value

A data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
connectionDetails <- createConnectionDetails(dbms = "mysql",
                                             server = "localhost",
                                             user = "root",
                                             password = "blah",
                                             schema = "cdm_v4")
conn <- connect(connectionDetails)
count <- querySql(conn, "SELECT COUNT(*) FROM person")
dbDisconnect(conn)

## End(Not run)

hxia/DatabaseConnector4Impala documentation built on May 17, 2019, 9:15 p.m.