Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
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


Thread View

Thread Author Date
undefined method 'fetch_row'Simon Macneall2010-07-16 08:30
      RE: undefined method 'fetch_row'Praveen Devarao2010-07-16 08:59
            RE: undefined method 'fetch_row'Praveen Devarao2010-07-16 09:21
                  RE: undefined method 'fetch_row'Simon Macneall2010-07-16 11:13
                        RE: undefined method 'fetch_row'Praveen Devarao2010-07-16 12:13
                              RE: undefined method 'fetch_row'Simon Macneall2010-07-16 12:21
                                    RE: undefined method 'fetch_row'Praveen Devarao2010-07-16 12:31
                                          RE: undefined method 'fetch_row'Simon Macneall2010-07-16 12:33

Post a followup to this message