C
C
Chronic 862016-07-27 17:00:59
ruby
Chronic 86, 2016-07-27 17:00:59

How to save data to a file?

require "oci8"
require "sequel"

DB = Sequel.oracle('DBSID', :user=>'user', :password=>'password')

DB.fetch("SELECT * from companies").collect{|data| data[:name]}

How to save the data received by the request to a txt file? Googled as much as I could...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Chernik, 2016-07-27
@vladchernik

File.open(yourfile, 'w') { |file| file.write("your text") }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question