Description Usage Arguments Details Value Side Effects References See Also Examples
Oracle driver initialization and closing.
1 2 3 4 | ## S4 method for signature 'OraDriver'
dbUnloadDriver(drv, ...)
## S4 method for signature 'ExtDriver'
dbUnloadDriver(drv, ...)
|
drv |
An object that inherits from |
... |
Any other arguments to pass to the driver |
This object is a singleton, that is, subsequent invocations of
dbDriver
return the same initialized object.
This implementation allows you to connect to multiple host servers and run multiple connections on each server simultaneously.
When interruptible
is set to TRUE, it allows for interrupting
long-running queries on the server by executing the query in a thread.
Main thread checks for Ctrl-C and issues OCIBreak/OCIReset to cancel the
operation on the server. By default, interruptible
is FALSE.
When unicode_as_utf8
is set to FALSE, NCHAR, NVARCHAR and NCLOB
data is fetched using the character set specified by the NLS_LANG
setting. By default, unicode_as_utf8
is set to TRUE.
When ora.attributes
is set to TRUE, the result set from
dbGetQuery
and fetch
contains DBMS-specific attributes like
ora.encoding
, ora.type
, and ora.maxlength
for the
corresponding column.
This implementation removes communication links between the R client and the database. It frees all connections and all result sets associated with those connection objects.
dbDriver |
An object |
dbUnloadDriver |
Free all resources occupied by the driver object. |
The R client part of the database communication is initialized,
but note that connecting to the database engine needs to be done through
calls to dbConnect
.
Remove the communication link between the R client and the database.
For Oracle Database documentation, see http://www.oracle.com/technetwork/indexes/documentation/index.html.
Oracle
,
dbConnect
,
dbSendQuery
,
dbGetQuery
,
fetch
,
dbCommit
,
dbGetInfo
,
dbListTables
,
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 29 30 31 32 33 34 35 36 | ## Not run:
# first load the library
library("ROracle")
# create an Oracle instance
drv <- dbDriver("Oracle")
con <- dbConnect(drv, "scott", "tiger")
dbListTables(con)
# fetch all results from the emp table
res <- dbGetQuery(con, "select * from emp")
# dbSendQuery can be used to fetch data in chunks
# as well as all of data at once
res <- dbSendQuery(con, "select * from emp")
# fetch all results
fetch(res)
# or a chunk at a time
fetch(res, n = 5)
# describing the schema for the emp table using dbGetInfo
dbGetInfo(res, what = 'fields')
# clear the result
dbClearResult(res)
# disconnect from the database
dbDisconnect(con)
# free the driver object
dbUnloadDriver(drv)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.