Title / Description
Code class PatstatResqueWorker @queue = :patstat_worker_q def self.perform(queryid) puts "*******************************************************I'm a ResqueWorker and I'm working...***************************************************" patstatrouterPathquery = PatstatrouterPathquery.find(queryid) # puts patstatrouterPathquery.sql_query results = ActiveRecord::Base.connection.execute(patstatrouterPathquery.sql_query) # results = ActiveRecord::Base.connection.execute("Delete FROM idp.patstatrouter_pathqueries where id = 11") directory = "public" fileName = DateTime.now.to_s(:number) puts fileName File.open(File.join(directory, "#{fileName}.xls"), 'w') do |f| f.puts patstatrouterPathquery.sql_query results.each do |res| # puts res #prints hole row # puts res[0], res[1], res[2] #catch each column this way f.puts "#{res[0]} \t #{res[1]} \t #{res[2]}" #string congcatanation with tab. >> "#{variable} normal string" end end puts "******************************************************* I'm still alive :) *******************************************************" end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code