dbConnect-methods {ROracle}R Documentation

Create a connection object to an Oracle DBMS

Description

These methods are straight-forward implementations of the corresponding generic functions.

Methods

drv
an object of class OraDriver, or the character string "Oracle" or an OraConnection.
conn
an OraConnection object as produced by dbConnect.
username
string of the Oracle login name
.
password
string with the Oracle password
.
dbname
string with the Oracle SID, System Identification (database name). The default takes this fromt the environment variable ORACLE\_SID
.
...
Must specify user, password and optionally dbname. Also you may specify an Oracle connection string, e.g., "user/password@SID".

Side Effects

A connection between R/S-Plus and an Oracle server is established. The current implementation supports up to 10 simultaneous connections.

References

See the Database Interface definition document DBI.pdf in the base directory of this package or http://stat.bell-labs.com/RS-DBI.

See Also

Oracle, dbConnect, dbSendQuery, dbGetQuery, fetch, dbCommit, dbGetInfo, dbReadTable.

Examples

## Not run: 
# create an Oracle instance and create one connection.
drv <- dbDriver("Oracle")

# open the connection using user, passsword, etc., as
con <- dbConnect(drv, "user/password@dbname")

# Run an SQL statement by creating first a resultSet object
rs <- dbSendQuery(con, statement = paste(
                      "SELECT w.laser_id, w.wavelength, p.cut_off",
                      "FROM WL w, PURGE P", 
                      "WHERE w.laser_id = p.laser_id", 
                      "SORT BY w.laser_id")
# we now fetch records from the resultSet into a data.frame
data <- fetch(rs, n = -1)   # extract all rows
dim(data)
## End(Not run)

[Package ROracle version 0.5-7 Index]