Question

I am using RSQLite package for database operations. For selecting data from table, I used the following code, but I got only 500 rows. Actually this table contains 1200+ rows for that query. What is the cause of this problem?

library('RSQLite')
lite <- dbDriver("SQLite", max.con = 25)
db <- dbConnect(lite, dbname = "pf.db")
res <- dbSendQuery(db, paste("SELECT ticker from RUS1000 where portDate='1995-12-29'  ",sep=""))
data <- fetch(res)
print(data)
Était-ce utile?

La solution

Try data <- fetch(res,n=-1). This will fetch all rows.

Autres conseils

or try the easy way

data <- dbGetQuery.....
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top