2

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)
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Dinoop Nair
  • 2,663
  • 6
  • 31
  • 51

2 Answers2

3

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

imran
  • 1,560
  • 10
  • 8
3

or try the easy way

data <- dbGetQuery.....
Dieter Menne
  • 10,076
  • 44
  • 67