Re: [R] ROracle - fetch gives empty dataframe

From: Rado Bonk <rado.bonk_at_jrc.it>
Date: Thu 15 Jul 2004 - 01:05:25 EST

Michael,

Yes you are right, I forgot to specify the dbname when posting in R-help list. But not in my R-code, since it is specified in ORACLE_SID variable on Linux. Using the proper syntax I still get an empty data frame:

> library(ROracle)
> drv <- dbDriver("Oracle")
> con <- dbConnect(drv, "rado/mypassword@dea")
> dbListTables(con)

character(0)
> q.sql <- c("select * from si_r where id=498")
> rs <- dbSendQuery(con, q.sql)
> data <- fetch(rs, n= -1)
> dim(data)
[1] 0 3
> dbGetStatement(rs)

[1] "select * from si_r where id=498"
> dbGetInfo(con)

$dbname
[1] "dea"

$user
[1] "rado"

$passwd
[1] "mypassword"

$conType
[1] NA

$serverVersion
[1] NA

$protocolVersion
[1] NA

$threadId
[1] -1

$resultSetIds
$resultSetIds[[1]]
<OraResult:(15551,0,2)>

> data

[1] ID DAY R
<0 rows> (or 0-length row.names)

> 
>>### CONNECTION, and SQL QUERY EXECUTION
>> > ora <- dbDriver("Oracle")
>> > con <- dbConnect(ora, "rado/only2admin"
> 
> 
> Which database???

-- 
Radoslav Bonk
European Commission - DG Joint Research Centre (JRC)
Institute for Environment and Sustainability (IES)
LM Unit - Natural Hazards
Weather Driven Natural Hazards Action
Via E. Fermi, TP 261, 21020 Ispra (Va), Italy
Tel.: 0039-0332-786013
Fax: 0039-0332-786653
Webpage: http://natural-hazards.jrc.it/floods/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Jul 15 01:13:46 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:57 EST