deebee
provides set of functions that allows to execute SQL queries in:
Functions are relatively easy to use after the package is installed. Some of the code result in the following chunks can be listed with errors as this was executed in a development environment.
The most basic command is to execute a SQL query using the OraRun_
function. This functions takes the SQL along with the connection information to execute a query and returns the resultset in a tibble.
OraRun_("SELECT OWNER, TABLE_NAME, TABLESPACE_NAME FROM ALL_TABLES", host_name = "localhost", port = "1521", sid = "xe", user_name = "sc", pwd = "tiger")
To avoid passing repetitive connection information, another function OraRun
can be used. The above command can be executed as:
#create a connection string with prefix as "ora_connstr_" ora_connstr_stg <- list(host_name = "localhost", port = "1521", sid = "xe", user_name = "sc", pwd = "tiger") #call OraRun once the connection string is defined OraRun("SELECT OWNER, TABLE_NAME, TABLESPACE_NAME FROM ALL_TABLES", "stg")
ODBCRun
is implemented to use a DSN to establish a connection to execute a query.
ODBCRun("SELECT OWNER, TABLE_NAME, TABLESPACE_NAME FROM ALL_TABLES", "LOCAL_XE")
CompareOraDataset
helps in comparing resultsets from two environments.
#create a connection string with prefix as "ora_connstr_" ora_connstr_stg1 <- list(host_name = "localhost", port = "1521", sid = "xe", user_name = "sc", pwd = "tiger") ora_connstr_stg2 <- list(host_name = "localhost", port = "1521", sid = "xe", user_name = "sc", pwd = "tiger") ReconResults("SELECT OWNER, TABLE_NAME, TABLESPACE_NAME FROM ALL_TABLES", "stg1", "stg2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.