Description Usage Arguments Details Value Side Effects References See Also Examples
These methods are straight-forward implementations of the corresponding
generic functions except for the execute
method, which is an
ROracle specific DBI extension.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## S4 method for signature 'OraConnection,character'
dbSendQuery(conn, statement, data = NULL,
prefetch = FALSE, bulk_read = 1000L, bulk_write = 1000L, ...)
## S4 method for signature 'OraConnection,character'
dbGetQuery(conn, statement, data = NULL,
prefetch = FALSE, bulk_read = 1000L, bulk_write = 1000L, ...)
## S4 method for signature 'OraConnection,character'
oracleProc(conn, statement, data = NULL,
prefetch = FALSE, bulk_read = 1000L, bulk_write = 1000L, ...)
## S4 method for signature 'OraResult'
dbClearResult(res, ...)
## S4 method for signature 'OraConnection'
dbGetException(conn, ...)
execute(res, ...)
## S4 method for signature 'OraResult'
execute(res, data = NULL, ...)
|
conn |
An |
statement |
A character vector of length 1 with the SQL statement. |
res |
An |
data |
A |
prefetch |
A logical value that specifies whether ROracle uses prefetch buffers or an
array fetch to retrieve data from the server. If |
bulk_read |
An integer value indicating the number of rows to fetch at a time. The default value is 1000L. When the prefetch option is selected, memory is allocated for prefetch buffers and OCI fetches the specified number of rows at a time. When prefetch is not used, which is the default, memory is allocated in RODBI/ROOCI define buffers. Setting this to a large value results in more memory being allocated based on the number of columns in the select list and the types of columns. For a column of type character, define buffers are allocated using the maximum width times the NLS maximum width. An application should adjust this value based on the query result. A larger value benefits queries that return a large result. The application can tune this value as needed. |
bulk_write |
An integer value indicating the number of rows to write at a time. The
default value is 1000L. When a bulk_write value is specified, memory is
allocated for buffers and OCI writes that many rows at a time. If the
bulk_write argument is not used, then the default value is used to
allocate memory for the bind buffers. Setting |
... |
Currently unused. |
This function executes a query statement and fetches the result data from the database. It should not be used for calling PL/SQL queries.
This function executes a query statement and returns a result set to the application. The application can then perform operations on the result set. It should not be used for calling PL/SQL queries.
This function executes a PL/SQL stored procedure or function query statement and returns the result.
This function frees resources used by result set.
This function retrieves error information.
This function executes the specified query statement.
dbSendQuery |
An |
Query statement is executed and data is fetched from database.
Query statement is executed, but data needs to be fetched through
calls to fetch
.
PL/SQL stored procedure or function query statement is executed and result is returned.
Resources acquired by the result set are freed.
Error information is retrieved and then cleaned from the driver.
Query statement is executed.
For the Oracle Database documentation see http://www.oracle.com/technetwork/indexes/documentation/index.html.
Oracle
,
dbDriver
,
dbConnect
,
fetch
,
dbCommit
,
dbGetInfo
,
dbReadTable
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
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)
data1
res3 <- dbSendQuery(con, "select * from emp where deptno = :1",
data2 <- data.frame(deptno = 10), bulk_read=10L)
data2 <- fetch(res3, n = -1)
data2
res4 <- dbSendQuery(con, "select * from emp where deptno = :1",
data3 <- data.frame(deptno = 10), bulk_write=10L)
data3 <- fetch(res4, n = -1)
data3
res5 <- dbSendQuery(con, "select * from emp where ename = :1",
data4 <- data.frame(ename = 'SMITH'))
data4 <- fetch(res5, n = -1)
data4
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.