public void testUpdate8() throws SQLException {
  statement.executeUpdate("UPDATE " + DatabaseCreator.SIMPLE_TABLE3 + " SET speed = (SELECT MAX(speed) FROM "+ DatabaseCreator.SIMPLE_TABLE1+ ") WHERE id = (SELECT id FROM "+ DatabaseCreator.SIMPLE_TABLE1+ " WHERE speed = (SELECT MAX(speed) FROM "+ DatabaseCreator.SIMPLE_TABLE1+ "))");
  ResultSet r=statement.executeQuery("SELECT id FROM " + DatabaseCreator.SIMPLE_TABLE3 + " WHERE speed = (SELECT MAX(speed) FROM "+ DatabaseCreator.SIMPLE_TABLE1+ ");");
  r.next();
  assertEquals("Incorrect id updated",1,r.getInt(1));
  r.close();
}

public void testUpdate8 ( ) throws SQLException { statement . executeUpdate ( "UPDATE " + DatabaseCreator . SIMPLE_TABLE3 + " SET speed = (SELECT MAX(speed) FROM " + DatabaseCreator . SIMPLE_TABLE1 + ") WHERE id = (SELECT id FROM " + DatabaseCreator . SIMPLE_TABLE1 + " WHERE speed = (SELECT MAX(speed) FROM " + DatabaseCreator . SIMPLE_TABLE1 + "))" ) ; ResultSet r = statement . executeQuery ( "SELECT id FROM " + DatabaseCreator . SIMPLE_TABLE3 + " WHERE speed = (SELECT MAX(speed) FROM " + DatabaseCreator . SIMPLE_TABLE1 + ");" ) ; r . next ( ) ; assertEquals ( "Incorrect id updated" , 1 , r . getInt ( 1 ) ) ; r . close ( ) ; }
updatefunctionalitytest2 # testupdate8 ( ) . updates table using scalar subquery as new field value
