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)
Was it helpful?

Solution

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

OTHER TIPS

or try the easy way

data <- dbGetQuery.....
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top