Hello, according to the standard SQLSTATE codes, for an invalid date
format the SQLSTATE the code is 22007, but H2 current stable version
is returning the same internal code 90009 when calling
e.getSQLState():

org.h2.jdbc.JdbcSQLException: Imposible interpretar la constante de
fecha "XXX", causa: "format yyyy-mm-dd"
Cannot parse date constant "XXX", cause: "format yyyy-mm-dd"; SQL
statement:
INSERT INTO demo.test1(id, text_not_null, text_unique, text_type, id2)
VALUES (NEXTVAL('demo.seq_test1'), 'XXXX', 3, 'XXX', 1) --
(NEXTVAL('demo.seq_test1'), 'XXXX', 3, 'XXX', 1) [90009-155]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:
327)
        at org.h2.message.DbException.get(DbException.java:167)
        at org.h2.util.DateTimeUtils.parseDateTime(DateTimeUtils.java:259)
        at org.h2.value.ValueDate.parseDate(ValueDate.java:45)
        at org.h2.value.Value.convertTo(Value.java:812)
        at org.h2.table.Column.convert(Column.java:151)
        at org.h2.command.dml.Insert.insertRows(Insert.java:112)
        at org.h2.command.dml.Insert.update(Insert.java:84)
        at org.h2.command.CommandContainer.update(CommandContainer.java:71)
        at org.h2.command.Command.executeUpdate(Command.java:212)
        at org.h2.server.TcpServerThread.process(TcpServerThread.java:300)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
        at java.lang.Thread.run(Thread.java:662)

Error code: 90009
SQL State: 90009

Regards,
Martin

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to