From: Mark Hahn Date: 2001-12-08T00:50:36+09:00 Subject: [ruby-talk:27815] Re: DBI and large result sets You need to use an SQL CURSOR to do that. One could write code to make a true stream using the CURSOR. ----- Original Message ----- From: " JamesBritt" To: "ruby-talk ML" Sent: Thursday, December 06, 2001 8:26 PM Subject: [ruby-talk:27783] DBI and large result sets > I'm starting to use Ruby DBI, and I'm wondering about its use when processing > very large result sets. > > Given that DBI sits on top of various DB drivers, is there some way to use DBI > to run a query and process each record set without necessarily having to hold > the entire result set in memory? Or is DBI too abstract to allow you to make > any assumptions about that? > > DBI::StatementHandle has fetch_many, but I think it works on a local store of > the entire result set (whereas I want it to pull the data from the database > only as I request a number of rows). > > Basically I want the SQL query to behave like a stream, not a single, huge, > chunk o' data, but not have to tie the code to a specific database (if > possible). > > > Thanks, > > > James > >