Learn R Programming

ROracle (version 0.3-3)

parse.OraConParams: Parse an Oracle connection string

Description

Parse an oracle connections string of the form "user/password@dbname" to determine the three Oracle's connection parameters "username", "passwd" and "dbname".

Usage

parse.OraConParams(username="", password="", dbname=ifelse(usingR(), Sys.getenv("ORACLE_SID"), getenv("ORACLE_SID")))

Arguments

username
a character string of the form "username/passwd@dbname". Default is "".
password
an optional password. If non-empty and there's also a password in the connection string username, this password overrides the one in username. Default is "".
dbname
an optional database name (Oracle SID). If non-empty and there's also a database name in the connection string username, this database name overrides the one in username.

Value

  • A 3-element character vector with the username, passwd, and dbname suitable for a call to dbConnect.

Details

Both username and password may be emtpy, in which case the username is set to "/"; this instructs Oracle to use the operating system user/password authentication (Oracle needs to be set up to do this.)

References

http://developer.r-project.org/db

See Also

dbConnect, Oracle

Examples

Run this code
conParams <- parse.OraConParams("user/pwd@dbname")

Run the code above in your browser using DataLab