On Fri, 4 Aug 2006, Francis Cianfrocca wrote: > On 8/4/06, ara.t.howard / noaa.gov <ara.t.howard / noaa.gov> wrote: >> >> it's been a while since i used the ruby postgres bindings but, when i did, >> both 'query' and 'exec' took blocks to iterate over results sets. >> >> have you tried? > > Not sure that solves his problem, Ara- he wants to keep the library > from yanking the whole result set into RAM before it starts iterating > over his code. yes - that's what it does (used to do). looking at the source and samples/ it looks like it works this way now from samples/test1.rb res = conn.exec("FETCH ALL in myportal") ... for fld in res.fields printf("%-15s",fld) end printf("\n\n") ... res.result.each do |tupl| # we iterating here tupl.each do |fld| printf("%-15s",fld) end printf("\n") end dunno how to do that from dbi - never used it. regards. -a -- happiness is not something ready-made. it comes from your own actions. - h.h. the 14th dali lama