Rails temporary table?


#1

hi all
any one know how to create a temporary table and fill it, like:

#------------------------------------------------------------
create temporary table test1 select * from test;
#------------------------------------------------------------

regards.


#2

ActiveRecord::Base.connection.execute my_sql_string


#3

Joe B. <allenbobo@…> writes:

#------------------------------------------------------------
create temporary table test1 select * from test;
#------------------------------------------------------------

Using Migration/Schema parlance, you can do:

create_table (:test1), :temporary=> true do |t|
  t.column :field1, :string, :limit => 50
  t.column :field2, :string, :limit => 50
end

-damon
http://damonclinkscales.com/


#4

thanks

Kyle M. and Damon C.

cheers

Damon C. wrote:

Joe B. <allenbobo@…> writes:

#------------------------------------------------------------
create temporary table test1 select * from test;
#------------------------------------------------------------

Using Migration/Schema parlance, you can do:

create_table (:test1), :temporary=> true do |t|
  t.column :field1, :string, :limit => 50
  t.column :field2, :string, :limit => 50
end

-damon
http://damonclinkscales.com/