SQRL (version 1.0.2)

SQRL-package: Simple and Powerful ODBC Interfaces

Description

Streamlines interactive exploratory work, and short-order ad hoc jobs, on ODBC data sources.

Arguments

Author

Mike Lee

Details

Automatically generates a dedicated and like-named interface function to each ODBC DSN (Open DataBase Connectivity Data Source Name). These functions manage communications behind the scenes, whilst supporting multi-statement SQL scripts. Hybrid (SQRL) scripting syntax allows SQL with embedded R, thereby enabling parameterisation of queries, feedback of intermediate results, the addition of flow-control structures within and around SQL, and the use of libraries of stored scripts. Additional sources and interfaces can be defined at any time. The package is a wrapper about RODBC.

See Also

sqrlSources, sqrlUsage

Examples

Run this code
require(SQRL)

# Show (automatic) data sources.
sqrlSources()

if (FALSE) {
# If 'ratatoskr' were one of those sources (i.e.,
# if a DSN of that name was found), then a multi-
# statement query could be submitted like so:
ratatoskr("use yggdrasil; select messages from ",
          "vedfolnir where addressee = 'nidhogg' ",
          "limit ", 5)

# Submit a parameterised query from file.
ratatoskr("messages.sqrl", year = 950)

# Obtain help on usage.
ratatoskr("help")
}

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

if (FALSE) {
# Submit a query to the new source.
mysource("select * from database.table")
}

Run the code above in your browser using DataLab