Answer the question
In order to leave comments, you need to log in
How to resolve an error when executing a nested SQLite query?
Throws an Exception when executing the request. Can't find column "Nizhny" although Nizhny-Novgorod comes to cityName
public static void setCityIdToOrderByName(String cityName, int orderId) throws SQLException {
preparedStatement = connection.prepareStatement("UPDATE orders SET city_id = (SELECT c.id FROM city c WHERE c.name = " + cityName + ") WHERE id = " + orderId);
preparedStatement.executeUpdate();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question