ruby method calls with heredoc parameter and block
February 7th, 2009 • Uncategorized
This is taken from here and serves mainly as a reminder for myself.
dbh.execute(<<-STMT) { |sth|
select distinct customer, business_unit_id, business_unit_key_name
from problem_ticket_lz
order by customer
STMT
sth.fetch { |row|
print "#{row[1]}\t#{row[0]}\t#{row[2]}\n"
}
}