Learn R Programming

SQRL (version 0.5.0)

SQRL-package: SQRL

Description

Facilitates exploratory work and rapid prototyping with Open Database Connectivity (ODBC) data sources.

Arguments

Version

0.5.0

Details

The package is a wrapper about RODBC. On load, it looks for data source names (DSNs) and attempts to create a like-named interface function for each. Additional data-source interfaces can be defined at any time. These functions support multi-statement SQL scripts, with or without parameters or embedded R expressions, and dispense with the need to provide explicit communication details with every query.

See Also

sqrlInterface, sqrlUsage, RODBC

Examples

Run this code
# NOT RUN {
require(SQRL)

# Show (pre)defined data sources.
sqrlSources()

# Define a new data source.
sqrlSource("mysource",
            driver = "MYSQL ODBC 5.3 ANSI Driver",
            server = "localhost",
            user = "<uid>",
            password = "<pwd>")

# Obtain help on usage (in text format).
mysource("help", "text")

# }
# NOT RUN {
# Submit a query to the new source.
mysource("select 1")

# Submit a parameterised query from file.
mysource("transactions.sqrl", customerid = 111111)

# Define a source from file.
sqrlSource("ratatoskr", "~/yggdrasil")

# Submit a query to that source.
ratatoskr("select messages from vedfolnir ",
          "where addressee = 'nidhogg'")
# }

Run the code above in your browser using DataLab