Hi,
I would like to execute a SQL statement and manipulate its resultset...
My SQL wont return data that fits on any model, I just would like to
do something like this:
sql = <<-ENDS
SELECT
sum(a) AS F1,
min(b) AS F2
FROM
MyTable
ENDS
resultSet = ActiveRecord::Base.connection.execute(sql)
resultSet.each do |row|
logger.info "Field1: " + resultSet[''F1'']
logger.info "Field2: " + resultSet[''F2'']
end
I made this example up to show my idea, my real case is more
complicated, but I think I passed the idea here.
Thanks in advance
Acras
--
Ricardo Acras
ricardo-WlbSPrj98RBeoWH0uzbU5w@public.gmane.org
Acras Desenvolvimento de Sistemas
+55+41-3232-6404
www.acras.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---