This function sends SQL to the server, and returns the results.
querySql(
connection,
sql,
errorReportFile = file.path(getwd(), "errorReportSql.txt"),
snakeCaseToCamelCase = FALSE,
integerAsNumeric = getOption("databaseConnectorIntegerAsNumeric", default = TRUE),
integer64AsNumeric = getOption("databaseConnectorInteger64AsNumeric", default = TRUE)
)
Arguments
The connection to the database server created using either connect()
or DBI::dbConnect()
.
The SQL to be send.
The file where an error report will be written if an error occurs. Defaults to 'errorReportSql.txt' in the current working directory.
If true, field names are assumed to use snake_case, and are converted to camelCase.
Logical: should 32-bit integers be converted to numeric (double) values? If FALSE 32-bit integers will be represented using R's native Integer
class.
Logical: should 64-bit integers be converted to numeric (double) values? If FALSE 64-bit integers will be represented using bit64::integer64
.
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. Null values in the database are converted to NA values in R.
Examplesif (FALSE) { # \dontrun{
connectionDetails <- createConnectionDetails(
dbms = "postgresql",
server = "localhost",
user = "root",
password = "blah",
schema = "cdm_v4"
)
conn <- connect(connectionDetails)
count <- querySql(conn, "SELECT COUNT(*) FROM person")
disconnect(conn)
} # }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4