Forum: Ruby on Rails rails temporary table?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E13ba8e702211be152c640df2d8e141f?d=identicon&s=25 Joe Black (joe-black)
on 2006-02-20 18:36
hi all
any one know how to create a temporary table and fill it, like:

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

regards.
4bd34a2216dc8bdbf1f017f64e4d59e8?d=identicon&s=25 Kyle Maxwell (Guest)
on 2006-02-20 20:08
(Received via mailing list)
ActiveRecord::Base.connection.execute my_sql_string
97a7959f0d9e6c90ddae200520e93067?d=identicon&s=25 Damon Clinkscales (Guest)
on 2006-02-20 20:55
(Received via mailing list)
Joe Black <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/
E13ba8e702211be152c640df2d8e141f?d=identicon&s=25 Joe Black (joe-black)
on 2006-02-21 06:25
thanks

Kyle Maxwell and Damon Clinkscales

cheers


Damon Clinkscales wrote:
> Joe Black <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/
This topic is locked and can not be replied to.