class TestIbmDb2 < Test::Unit::TestCase

  def test_144
    assert_expect {
      ini_set( "safe_mode", 0 )
      conn = DB2::connect database, user, password
      if conn
        # Drop the test table, in case it exists
        drop = 'DROP TABLE pictures'
        result = DB2::exec(conn, drop) rescue nil
        # Create the test table
        create = 'CREATE TABLE pictures (id INTEGER, picture BLOB(500K))'
        result = DB2::exec conn, create
        stmt = DB2::prepare conn, "INSERT INTO pictures VALUES (0, ?)"
        rc = DB2::bind_param stmt, 1, "picture", DB2::PARAM_FILE, DB2::BINARY
        picture = "./pic1.jpg"
        rc = DB2::execute stmt
        num = DB2::num_rows stmt
        print num
      else
        puts "Connection failed."
      end
    }
  end

end

__END__
1
