hi, forgive my newbiness

So I started playing with pagination as strategy to port cursor using 
stored procs. 

I started to explore this by a simple test:

          database = Sequel.connect(active_oracle_url)
  cnt = 0
  table = database[:account]
  cursor = table.paginate 1,1000
  cursor.each { |ea|
              puts ea[:name]
              cnt += 1
        }

  puts "Count = #{cnt}"

Now, the "account" table has over 4000 rows

but count will show in the console as 1000

i.e. contrary to my expectations what I have setup above does not load 1000 
rows into memory at a time but rather loads 1000 rows from the offset of 1 
only.

What I need is something that will load all records into memory 1000 at a 
time i.e the underlying engine knows its finished with the current set and 
then issues the next query to get the next set of 1000.

Please pray tell me what I have missed. 

The objective is to be able to return a dataset that behaves that way i.e. 
that the result of "paginate" or whatever the right method is will return a 
dataset that will provide for iteration that will know when it needs to 
retrieve the next set of rows that meet the criteria of the dataset or in 
the case above non-filtered.

thanks in advance

-Charles

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sequel-talk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to