[R-sig-DB] TSSQLite
H. Felix Wittmann
h|w|ttm@nn @end|ng |rom goog|em@||@com
Wed Feb 17 15:06:42 CET 2010
Hi Paul,
thanks for your excellent package family centered around 'TSdbi'. In the
latest version I've run into a bug (or is it just me?). The bug
concerns the generic function TSexists (and by extension TSreplace).
I am using the following *setup*
/Ubuntu Karmic Koala/
/R version 2.10.1 (2009-12-14)/
/'TSSQLite' version 2009.10-1/
/'TSdbi' version 2009.11-1/
/'RMySQL' version 0.7-4/
/'timeSeries' version 2110.87/
I have noticed that in the /TSSQLite/-package there is no method defined
for the the generic function TSexists. I am not sure whether this is
intended.
If I load a connection to a database, and run */TSexists("xyz", con)/*,
where xyz is not yet in the database I get the following error
Error in TSdbi:::TSgetSQL(serIDs, con, TSrepresentation =
TSrepresentation, :
Meta lookup for series xyz table result empty. Series does not
exist on database.
Calls: TSexists ... <Anonymous> -> TSget -> TSget -> .local ->
<Anonymous>
I can make it work using the following patch
setMethod("TSexists", signature(serIDs="character",
con="SQLiteConnection"),
definition=function(serIDs, con, ...) {
sqlQuery <- paste("select count(*) from meta where id = '",
serIDs , "'" , sep ="")
out <- new("logicalId",as.logical(dbGetQuery (con,sqlQuery)))
return(out)
})
best regards
Felix
[[alternative HTML version deleted]]
More information about the R-sig-DB
mailing list