SQRL (version 0.6.2)

SQRL-package: Database Query Interfaces

Description

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

Arguments

Version

0.6.2

Details

Automatically creates like-named interface functions to ODBC data source names (DSNs). These functions support multi-statement SQL scripts, with or without arguments, embedded R expressions, or flow-control structures.

Additional interfaces can be defined at any time. Set-and-forget communication parameters are managed behind the scenes. The package is a wrapper about RODBC.

See Also

sqrlSources, sqrlUsage

Examples

Run this code
# NOT RUN {
require(SQRL)

# Show (automatic) data sources.
sqrlSources()

# }
# NOT RUN {
# If ratatoskr were one of those sources
# (i.e., if a DSN of that name was found),
# then a query could be submitted like so:
ratatoskr("select messages from vedfolnir ",
          "where addressee = 'nidhogg' ",
          "limit ", 5)
# }
# NOT RUN {
# Define a new data source.
sqrlSource("mysource",
            driver = "MYSQL ODBC 5.3 ANSI Driver",
            server = "localhost",
            user = "<uid>",
            password = "<pwd>")

# }
# NOT RUN {
# Obtain help on usage.
mysource("help")

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

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

Run the code above in your browser using DataLab