sqlFileExecute: Return the results of running SQL file

Description Usage Arguments Details Value Examples

Description

sqlFileExecute returns the results of an SQL query, as a data frame

Usage

1
sqlFileExecute(sqlFile, stringsAsFactors = TRUE, connectVar)

Arguments

sqlFile

String. The path to your .sql file

stringsAsFactors

Boolean. Will strings be converted to factors?

connectVar

RODBC Connection. Name of the object holding your ODBC connection.

Details

This function makes it convenient to develop your SQL in whatever IDE you choose, without copy/pasting code to your R script–which would make maintenance tedious.

Value

Data frame containing the results of your SQL query executed agaist the named channel.

Examples

1
df = sqlFileExecute(sqlFile = 'file/path/exampleQuery.sql', stringsAsFactors = FALSE)

TonyBlonigan/sqlTemplateR documentation built on May 14, 2019, 6:08 a.m.