I am trying to set a previously set date field to null in oracle using hibernate but once the "nullable" column is set to a date, I can't set it to null again because I don't know how to represent the null date to pass as a parameter in the below query.
Query updateQuery; updateQuery = em.createNativeQuery("UPDATE STATION SET MOD_DT = ?1 WHERE STATION_ID = ?2"); updateQuery.setParameter(2, stationId); updateQuery.setParameter(1, null); updateQuery.executeUpdate(); Log:
g! Dec 02, 2014 4:41:46 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions WARN: SQL Error: 932, SQLState: 42000 <02-Dec-2014 16:41:46 o'clock EET> <Warning> <org.hibernate.engine.jdbc.spi.SqlExceptionHelper> <BEA-000000> <SQL Error: 932, SQLState: 42000> Dec 02, 2014 4:41:46 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: ORA-00932: inconsistent datatypes: expected DATE got BINARY <02-Dec-2014 16:41:46 o'clock EET> <Error> <org.hibernate.engine.jdbc.spi.SqlExceptionHelper> <BEA-000000> <ORA-00932: inconsistent datatypes: expected DATE got BINARY>