Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying query results

Status
Not open for further replies.

jorbroni

Technical User
Dec 5, 2002
24
US
I am new to programming in ruby. I was trying to write a method that will display my query results on screen in the format that I want it in. below is my script:

#!/usr/bin/ruby

def getbatch( batchno )
sql = "
SELECT *
FROM feecalc.payments
WHERE batchnumber = '#{batchno}'"

Db.doQuery('acctdb',sql ).each do|r|

puts r['checkno']
puts r['datepaid']
puts r['checkamount']
puts r['Gross']
puts r['Credit_Fee']
puts r['ProcessFee']
puts r['CB/ReturnChkFee']
puts r['Reserves']
end

end


Can anyone tell me what I am doing wrong because when I run the script, nothing is printed on screen.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top