require 'ibm_db2'
require 'stringio'
require 'test/unit'

class TestIbmDb2 < Test::Unit::TestCase

  def test_016
    assert_equal expected, capture {
      conn = DB2::connect(db,username,password)
      if conn
        result = DB2::exec(conn,"insert into t_string values(123,1.222333,'one to one')")
        if result
          cols = DB2::num_fields(result)
          puts'col: ' . cols . ','
          rows = DB2::num_rows(result)
          puts'affected row: ' . rows 
        else
          putsDB2::stmt_errormsg();    
        end
        result = DB2::exec(conn,"delete from t_string where a=123")
        if result
          cols = DB2::num_fields(result)
          puts'col: ' . cols . ','
          rows = DB2::num_rows(result)
          puts'affected row: ' . rows 
        else
          putsDB2::stmt_errormsg();    
        end
        DB2::close(conn)
      else
        puts'no connection: ' . DB2::conn_errormsg();    
      end
    }
  end

end

__END__
col: 0,affected row: 1col: 0,affected row: 1 
