Hello,
MySQL supports ( since at leat >5.5) an ORDER BY clause with the DELETE
statement.
this does not seem to be supported by H2 (tested version: 1.4.197), even
with MODE=MYSQL in the datasource name.
Providing a query like :
DELETE FROM table1 ORDER BY field1 DESC LIMIT 100
leads to a Syntax Error (whereas this is a valid query with MySQL).
Syntax error in SQL statement "DELETE FROM table1 WHERE field1 < ? ORDER[*]
BY TS DESC "; SQL statement:
[42000-197]
org.h2.jdbc.JdbcSQLException:
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.message.DbException.getSyntaxError(DbException.java:203)
at org.h2.command.Parser.getSyntaxError(Parser.java:548)
at org.h2.command.Parser.prepareCommand(Parser.java:281)
at org.h2.engine.Session.prepareLocal(Session.java:611)
at org.h2.engine.Session.prepareCommand(Session.java:549)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:76)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:304)
...
Is it possible to implement it? at least, in a way that the parser will
accept it, even if not really performed on the data?
Thanks,
Gabriel
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/h2-database/80f343bf-43a6-4456-9e05-6dbfa5be58b4%40googlegroups.com.