Hi, I just installed ROracle and RDBI. The connection to the database seems to work also. My problem is when I am selection rows that really exist in the database, it is returning nothing. Where should I look to see what could be my problem? Thank you very much, Mathieu > drv <- dbDriver("Oracle") > summary(drv, verbose=TRUE) <OraDriver:(6721)> Driver name: Oracle (ProC/C++) Max connections: 10 Conn. processed: 8 Default records per fetch: 500 Oracle R/S client version: 0.5-4 RS-DBI version: 0.1-9 Open connections: 2 1 <OraConnection:(6721,0)> 2 <OraConnection:(6721,7)> > > conn <- dbConnect(drv, "mathieu/toto at MYDB") > summary(conn, verbose=TRUE) <OraConnection:(6721,7)> User: mathieu Dbname: MYDB Oracle Server version: > > rs <- dbSendQuery(conn, statement = paste("select * from cat")) > summary(rs, verbose=TRUE) <OraResult:(6721,7,2)> Statement: select * from cat Has completed? no Affected rows: 0 Rows fetched: -1 Fields: name Sclass type len precision scale isVarLength nullOK 1 TABLE_NAME character VARCHAR2 30 0 0 TRUE FALSE 2 TABLE_TYPE character VARCHAR2 11 0 0 TRUE TRUE > > myContent <- fetch(rs, n = -1) > myContent [1] TABLE_NAME TABLE_TYPE <0 rows> (or 0-length row.names) > summary(myContent, verbose=TRUE) TABLE_NAME TABLE_TYPE Length:0 Length:0 Class :character Class :character Mode :character Mode :character > summary(rs, verbose=TRUE) <OraResult:(6721,7,2)> Statement: select * from cat Has completed? yes Affected rows: 0 Rows fetched: -1 Fields: name Sclass type len precision scale isVarLength nullOK 1 TABLE_NAME character VARCHAR2 30 0 0 TRUE FALSE 2 TABLE_TYPE character VARCHAR2 11 0 0 TRUE TRUE
Hello, I'm working with irregular time series data. What do you all think about the strengths and weaknesses of the "zoo" and "its" packages? I've installed and skimmed the documentation on both packages. I was hoping to get a little guidance from the user community before proceeding further. In case anyone is interested in my particular problem: I'm looking at some (surface) temperature data from NOAA: http:// cdo.ncdc.noaa.gov/ulcd/ULCD It is (irregular) time series format. The NOAA data reports year, month, date, hour, and minute. I want to group the data into hourly chunks. However, sometimes there are multiple observation per hour -- i.e an observation at 3:45 and 3:56. Also, sometimes a particular hour may be missing altogether. I need to clean up the data so that each hour has one and only one data point. I'm relatively new to R, but I think I'm getting a hold on it pretty well so far. I used to do a lot with MATLAB, and there seem to be many parallels between it and R. I have background in public policy and econometrics. Thanks, David On Aug 25, 2005, at 12:29 PM, Mathieu Drapeau wrote:> Hi, > I just installed ROracle and RDBI. The connection to the database > seems > to work also. My problem is when I am selection rows that really exist > in the database, it is returning nothing. Where should I look to see > what could be my problem? > > Thank you very much, > Mathieu > > >> drv <- dbDriver("Oracle") >> summary(drv, verbose=TRUE) >> > <OraDriver:(6721)> > Driver name: Oracle (ProC/C++) > Max connections: 10 > Conn. processed: 8 > Default records per fetch: 500 > Oracle R/S client version: 0.5-4 > RS-DBI version: 0.1-9 > Open connections: 2 > 1 <OraConnection:(6721,0)> > 2 <OraConnection:(6721,7)> > >> >> conn <- dbConnect(drv, "mathieu/toto at MYDB") >> summary(conn, verbose=TRUE) <OraConnection:(6721,7)> >> > User: mathieu > Dbname: MYDB > Oracle Server version: > >> >> rs <- dbSendQuery(conn, statement = paste("select * from cat")) >> summary(rs, verbose=TRUE) >> > <OraResult:(6721,7,2)> > Statement: select * from cat > Has completed? no > Affected rows: 0 > Rows fetched: -1 > Fields: > name Sclass type len precision scale isVarLength nullOK > 1 TABLE_NAME character VARCHAR2 30 0 0 TRUE FALSE > 2 TABLE_TYPE character VARCHAR2 11 0 0 TRUE TRUE > >> >> myContent <- fetch(rs, n = -1) >> myContent >> > [1] TABLE_NAME TABLE_TYPE > <0 rows> (or 0-length row.names) > >> summary(myContent, verbose=TRUE) >> > TABLE_NAME TABLE_TYPE > Length:0 Length:0 > Class :character Class :character > Mode :character Mode :character > >> summary(rs, verbose=TRUE) >> > <OraResult:(6721,7,2)> > Statement: select * from cat > Has completed? yes > Affected rows: 0 > Rows fetched: -1 > Fields: > name Sclass type len precision scale isVarLength nullOK > 1 TABLE_NAME character VARCHAR2 30 0 0 TRUE FALSE > 2 TABLE_TYPE character VARCHAR2 11 0 0 TRUE TRUE > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting- > guide.html >
Mathieu Drapeau <mathieu.drapeau at mcgill.ca> wrote:> Hi, > I just installed ROracle and RDBI. The connection to the database seems > to work also. My problem is when I am selection rows that really exist > in the database, it is returning nothing. Where should I look to see > what could be my problem?What platform are you running R on? And what version of Oracle? This sounds very familiar... are you building ROracle on Linux? -- David Hinds
I am using Linux Oracle Client 9i and I am running my R scripts on a Linux box. I logged on our Oracle administration interface and the queries that I launched were executed and returned many lines directly to my Linux box. It looks that the problem is with the fetch method. Thank you very much, Mathieu> Mathieu Drapeau <mathieu.drapeau at mcgill.ca <https://stat.ethz.ch/mailman/listinfo/r-help>> wrote: > >/ Hi,/> >/ I just installed ROracle and RDBI. The connection to the database seems /> >/ to work also. My problem is when I am selection rows that really exist /> >/ in the database, it is returning nothing. Where should I look to see /> >/ what could be my problem? />> What platform are you running R on? And what version of Oracle? This > sounds very familiar... are you building ROracle on Linux? > > -- David Hinds >
Mathieu Drapeau <mathieu.drapeau at mcgill.ca> wrote:> I am using Linux Oracle Client 9i and I am running my R scripts on a > Linux box.Does /usr/include/sqlca.h exist? This is a Postgres file. My hazy memory is that this conflicts with an Oracle header; and that if ROracle sees this one at compile time, you get empty query results. Try renaming this file to something else, then rebuild ROracle. -- Dave
Thanks!!! It is working now. Mathieu dhinds at sonic.net wrote:>Mathieu Drapeau <mathieu.drapeau at mcgill.ca> wrote: > > > >>I am using Linux Oracle Client 9i and I am running my R scripts on a >>Linux box. >> >> > >Does /usr/include/sqlca.h exist? This is a Postgres file. My hazy >memory is that this conflicts with an Oracle header; and that if >ROracle sees this one at compile time, you get empty query results. > >Try renaming this file to something else, then rebuild ROracle. > >-- Dave > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >