On Jan 19, 2008, at 8:47 AM, Lp wrote:
>
> Hello!
>
> Im a rails newbie, i like rails very much, but now I have a problem:
>
> I want to generate in one action about 3000 sql statements
> (mailtemplate that becomes generateted to a mail (with personal
> salutation,...)).
>
> I tried it with:
>
> x=0
> while x < 300
> q = mail.new(params...)
> q.save()
> end
>
>
> but thats muuuuch toooo slow.... Is there a chance to get the
> generated sql statement back and execute it afterwards with only one
> sql-execution statement?
>
While it''s not exactly the same as you are looking to do, there was a
discussion of something similar in this thread
http://www.ruby-forum.com/topic/136898
If you have the patience to get to the end (and it''s really not that
long), there is an example of extending ActiveRecord to support
return the generated SQL. It probably wouldn''t be too hard to do
what you are looking to do.
Peace,
Phillip
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---