Kotlin and Exposed ORM

827 views Asked by At

I get this exception:

org.jetbrains.exposed.exceptions.ExposedSQLException: java.sql.SQLDataException: ORA-01861: literal does not match format string

Why because of this :

object Register: Table(){

    val dat_od = date("DAT_OD")

}

And i am trying to fetch with this

SQL: SELECT ... Register.DAT_OD BETWEEN '2018-06-02' AND '2018-06-03'

And this is the select that works :

SELECT ... DAT_OD BETWEEN TO_DATE('02/06/2018', 'MM/DD/YYYY') and TO_DATE('06/06/2018', 'MM/DD/YYYY')

Yes i see the why, but i can't cast datetime to java.sql.date... , i can but then i do not need Exposed ORM ...

0

There are 0 answers