Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ROracle)
- host <- "xxx.xxx.xx.xxx"
- port <- 1521
- service <- "K" #? not sure exactly what does it mean service, is it name of server?i cannot really find any informations about it
- drv <- dbDriver("Oracle")
- connect.string <- paste(
- "(DESCRIPTION=",
- "(ADDRESS=(PROTOCOL=tcp)(HOST=", host, ")(PORT=", port, "))",
- "(CONNECT_DATA=(SERVICE_NAME=", service, ")))", sep = "")
- con <- dbConnect(drv, username = "user", password = "pwd", dbname = connect.string)
- dbGetInfo(con)
- $username
- [1] "user"
- $dbname
- [1] "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxx.xxx.xx.xxx)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=K)))"
- $serverVersion
- [1] "xx.x.x.x.x"
- $serverType
- [1] "Oracle RDBMS"
- $resTotal
- [1] 0
- $resOpen
- [1] 0
- $prefetch
- [1] FALSE
- $bulk_read
- [1] 1000
- $bulk_write
- [1] 1000
- $stmt_cache
- [1] 0
- $results
- list()
- library(RODBC)
- ch <- odbcConnect("K",uid="user", pwd = "pwd") # again question what is the first parameter? should it be server name?
- odbcGetInfo(ch)
- Warnmeldungen:
- 1: In odbcDriverConnect("DSN=K;UID=user;PWD=pwd") :
- [RODBC] FEHLER: Status IM002, Code 0, Nachricht [unixODBC][Driver Manager]Data source name not found, and no default driver specified
- 2: In odbcDriverConnect("DSN=K;UID=user;PWD=pwd") :
- ODBC-Verbindung fehlgeschlagen
- >
- > odbcGetInfo(ch)
- Fehler in odbcGetInfo(ch) : Argument ist kein offener RODBC-Kanal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement