2 Replies Latest reply on Oct 24, 2013 7:48 AM by David Miller

    undefined method `close' for nil:NilClass

    David Miller

      def test_func1

       

          begin

            db = Rho::RHO.get_src_db('BarcodeData')

            result_drop = db.execute_sql("DROP INDEX barcodedata_item_no")

            puts "result_drop #{result_drop}"

            result_create = db.execute_sql("CREATE INDEX barcodedata_test on \"BarcodeData\" (\"qty\")")

            puts "result_create #{result_create}"

          ensure

            db.close()

          end

          redirect '/app'

        end

       

      end

       

      Results in...

       

      APP| App error: undefined method `close' for nil:NilClass apps/app/AppData/app_data_controller.rb:1245:in `ensure in test_func1'

      apps/app/AppData/app_data_controller.rb:1245:in `test_func1'

       

      No 'puts' messages appear in the log.

       

      Any idea what the syntax is for the Database methods?  I am following the example in Rhomobile | Database but they don't appear to work.

       

      Many thanks for your assistance.