I need to archive an entire set of rows from one table to another, in
effect, doing this SQL:
INSERT INTO table1
SELECT * FROM table2 WHERE blah…
Should I just do bare SQL or is there some “bulk insert” functionality
exposed in ActiveRecord for me to use?
This functionality is in ActiveRecord::Extensions, http://blogs.mktec.com/zdennis/pages/ARE
however it is NOT released. The current interface setup for this is…
Model.insert_into OtherModel, :conditions=>{ … }
I’m not 100% on the api for it yet, but your thoughts could concrete it
or I could implement it in another way. What db are you
using right now?
Zach
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
I think the usage you propose is fine. I can’t think of anything fancy
that I’d need for my purposes.
Can you contact me privately at [email protected] and email me a few
different INSERT statements that you would hypothetically
use, I will make sure I add support for the MSSQL adapter for this
functionality.