On Feb 12, 7:42 am, "Joseph McDonald" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was wondering if execute_select could return the results even if no
> block is given. Right now, this works:
> @DB.execute_select(sql) { |rows|
> rows.each do |row|
> puts "row: #{row}"
> end
>
> }
>
> This doesn't (I think it used to):
> rows = @DB.execute_select(sql)
> rows.each do |row|
> puts "row: #{row}"
> end
This behavior was changed since some database backends (namely MySQL)
react badly if you forget to free the result. With the block syntax,
sequel can let you iterate over the result and then free it after
you're done.
Aman Gupta
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---