Hi All,
I am inserting data from one table to another by using following method
@data=RoyaltyReportFiles.find_by_sql("insert into royalty_reports
(artist_name, album_name) select artist_name, album_name from
temp_royalty_reports where id=328417")
it saves the data into royalty_reports table but it gives following
error and application crashes. i am using rails 1.2.5
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.all_hashes
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:482:in
`select'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
`select_all_without_query_cache'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:53:in
`select_all'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:74:in
`cache_sql'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:53:in
`select_all'
vendor/rails/activerecord/lib/active_record/base.rb:533:in `find_by_sql'
app/controllers/artists_controller.rb:8:in `index'
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---