| Message: 94233 |
 |
BY: Praveen Devarao (praveend) DATE: 2010-07-16 08:59 SUBJECT: RE: undefined method 'fetch_row' Hi Simon,
You will need to make a changes in the code. To use the driver methods you will need to call the methods on the IBM_DB module.
ActiveRecord::Base.connection.execute(sql) returns a statement handle. To fetch the results contained in the statement handle you will need make a call as below
...
res = ActiveRecord::Base.connection.execute(sql)
ids = Array.new
while (row = IBM_DB.fetch_array(res))
...
Note: you will need to use fetch_array instead of fetch_row. Check the driver doc for more details on different drivers APIs http://rubyibm.rubyforge.org/docs/driver/2.0.0/doc/
Let me know if you need more info or clarifications.
Thanks
Praveen | |