Posted By

Hisoka on 04/24/11


Tagged


Versions (?)

ROR - Iterating ResultSet


 / Published in: Ruby
 

  1. @db = DBI.connect(dbHost, dbUser, dbPass)
  2. puts "Finished Connecting"
  3. result = @db.execute("SELECT description FROM foods WHERE food_id = '01001'")
  4. result.fetch do |row|
  5. print "Food Description:" + row[0]
  6. end

Report this snippet  

You need to login to post a comment.