Hallo,
ich habe ein Problem mit folgenden Query:
Fehlermeldung:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 0, 746, tm.name, NULL, 0, 0, 0, CURRENT_DATE(), 0, 0, 0 FROM tm JOIN tm_s' at line 1
Diese Fehlermeldung bekomme ich nur wenn ich meine Applikation ausführe, wenn ich den Query in phpmyAdmin ausführe, tut er das was er tun muss. Hat es was mit den CURRENT_DATE zu tun?
Vielen Dank im vorraus!
ich habe ein Problem mit folgenden Query:
Java:
public static List<TM> getStandardTMs() {
try
{
PreparedStatement pstmt = dbConInstance.prepareStatement
("INSERT INTO tm (id, contract, name, description, ttp_internal, ttp_external, planed_time, lock_date, needs_comment, billable, calculable "+
"SELECT 0, 746, tm.name, NULL, 0, 0, 0, CURRENT_DATE(), 0, 0, 0 FROM tm "+
"JOIN tm_standard ON tm_standard.tm = tm.id "+
"JOIN user_customer ON user_customer.customer = tm_standard.customer "+
"WHERE user_customer.user = 121 ");
Log.trace(pstmt.toString());
pstmt.execute();
} catch (SQLException e)
{
String method = "getStandardTMs()";
Log.error("Error in " +method, e);
}
return null;
}
Fehlermeldung:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 0, 746, tm.name, NULL, 0, 0, 0, CURRENT_DATE(), 0, 0, 0 FROM tm JOIN tm_s' at line 1
Diese Fehlermeldung bekomme ich nur wenn ich meine Applikation ausführe, wenn ich den Query in phpmyAdmin ausführe, tut er das was er tun muss. Hat es was mit den CURRENT_DATE zu tun?
Vielen Dank im vorraus!
Zuletzt bearbeitet von einem Moderator: