Learn R Programming

ROracle (version 1.3-1.1)

OraConnection-class: Class OraConnection

Description

An Oracle connection class implementing the R database interface (DBI) API.

Arguments

Generators

The method dbConnect is the main generator.

Extends

Class "DBIConnection", directly. Class "DBIObject", by class "DBIConnection", distance 2.

Methods

dbDisconnect

signature(conn = "OraConnection"): ...

dbSendQuery

signature(conn = "OraConnection", statement = "character", prefetch = FALSE, bulk_read = 1000L, bulk_write = 1000L): ...

dbGetQuery

signature(conn = "OraConnection", statement = "character", prefetch = FALSE, bulk_read = 1000L, bulk_write = 1000L): ...

dbGetException

signature(conn = "OraConnection"): ...

dbListResults

signature(conn = "OraConnection"): ...

dbListTables

signature(conn = "OraConnection"): ...

dbReadTable

signature(conn = "OraConnection", name = "character"): ...

dbWriteTable

signature(conn = "OraConnection", name = "character", value = "data.frame"): ...

dbExistsTable

signature(conn = "OraConnection", name = "character"): ...

dbRemoveTable

signature(conn = "OraConnection", name = "character"): ...

dbListFields

signature(conn = "OraConnection", name = "character"): ...

dbCommit

signature(conn = "OraConnection"): ...

dbRollback

signature(conn = "OraConnection"): ...

dbGetInfo

signature(dbObj = "OraConnection"): ...

summary

signature(object = "OraConnection"): ...

show

signature(object = "OraConnection")

See Also

DBI classes: OraDriver-class OraConnection-class OraResult-class

Examples

Run this code
# NOT RUN {
ora <- dbDriver("Oracle")
## connecting without a connect string
con <- dbConnect(ora, "scott", "tiger")

## connecting with a connection string with SID
host <- "myhost"
port <- 1521
sid <- "mysid"
connect.string <- paste(
  "(DESCRIPTION=",
  "(ADDRESS=(PROTOCOL=tcp)(HOST=", host, ")(PORT=", port, "))",
  "(CONNECT_DATA=(SID=", sid, ")))", sep = "")

## use username/password authentication
con <- dbConnect(drv, username = "scott", password = "tiger",
                 dbname = connect.string)

## connecting with a connection string with service name
host <- "myhost"
port <- 1521
svc <- "mydb.example.com"
connect.string <- paste(
  "(DESCRIPTION=",
  "(ADDRESS=(PROTOCOL=tcp)(HOST=", host, ")(PORT=", port, "))",
  "(CONNECT_DATA=(SERVICE_NAME=", svc, ")))", sep = "")
## use username/password authentication
con <- dbConnect(drv, username = "scott", password = "tiger",
                 dbname = connect.string)

## Please refer to "Oracle Database Net Services Administator's Guide", which
## has the topic "Connect Identifier and Connect Descriptor Syntax
## Characteristics"

dbListTables(con)
# }

Run the code above in your browser using DataLab