Learn R Programming

ROracle (version 1.1-4)

dbSendQuery-methods: Execute a statement on a given database connection

Description

These methods are straight-forward implementations of the corresponding generic functions except for the execute method which is an ROracle specific DBI extension.

Arguments

conn
an OraConnection object.
statement
a character vector of length 1 with the SQL statement.
res
an OraResult object.
data
a data.frame specifying bind data
prefetch
a logical value indicating TRUE or FALSE. When set to TRUE, ROracle will use OCI prefetch buffers to retrieve additional data from the server thus saving memory required in RODBI/ROOCI by allocating a single row buffer to fetch the data from
bulk_read
an integer value indicating the number of rows to fetch at a time. Default is 25L. When prefetch option is select, memory is allocated for prefetch buffers and OCI will fetch those many rows at a time. When prefetch is not used(default) memor
lob_prefetch
an integer value indicating the size of lob data that can be prefetched and cached while fetching lob data. Default is 1024L.
...
additional parameters.

Value

  • dbSendQueryan object OraResult whose class extends DBIResult. This object is used to fetch data from database, using the function fetch.

References

For the Oracle Database documentaion see http://www.oracle.com/technetwork/indexes/documentation/index.html.

Details

[object Object],[object Object],[object Object],[object Object],[object Object]

See Also

Oracle, dbDriver, dbConnect, fetch, dbCommit, dbGetInfo, dbReadTable.

Examples

Run this code
drv <- dbDriver("Oracle")
    con <- dbConnect(drv, "scott", "tiger")
    res <- dbSendQuery(con, "select * from emp where deptno = :1",
                       data = data.frame(deptno = 10))
    data <- fetch(res, n = -1)
    res2 <- dbSendQuery(con, "select * from emp where deptno = :1",
                        data1 = data.frame(deptno = 10), prefetch=TRUE,
                        bulk_read=2L)
    data1 <- fetch(res2, n = -1)
    res3 <- dbSendQuery(con, "select * from emp where deptno = :1",
                        data2 = data.frame(deptno = 10), bulk_read=10L)
    data2 <- fetch(res3, n = -1)
    res4 <- dbSendQuery(con, "select * from emp where ename = :1",
                        data3 = data.frame(ename = 'SMITH'), 
                        lob_prefetch=3000L)
    data3 <- fetch(res4, n = -1)

Run the code above in your browser using DataLab