On Jan 5, 12:10 pm, Marnen Laibow-Koser <[email protected]> wrote: > Jatin Kumar wrote in post #972576: > > > But, If you are certain that you are going to use > > MySQL > > or a specific DB for an app then I guess there is no problem in going > > for > > SQL queries. > > Not quite. If I need literal SQL (which is rare), my practice is to > write it as far as possible in terms compliant with standard ANSI SQL > syntax, without proprietary extensions. This gives the best portability > across databases.
Just tacking on another suggestion to this if people are reading back through here: if you do need literal SQL its a good idea to put it in a configuration file with a lookup key (i.e. :count_all_my_angry_birds); that way if you switch db engines or support multiple ones all your specific SQL is in one location that you can ensure works for whatever different dbs you need to support. And of course keep that file as ANSI compliant so that there are as little changes required as possible. \Peter -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

