i am trying to run the below query i am getting the a non-numeric character was found where a numeric was expected here is the query
select * from schedule where to_date(SHDL_STRT_TIME,'dd-MON-yy HH24:mi:ss')
IN('11-Jan-15 20:30:00','11-Jan-15 08:00:00','11-Jan-15 20:00:00')
SHDL_STRT_TIME is already of type
DATE, so you don't need to use
TO_DATE() over it.
TO_CHAR() which is what you needed!!!
MON gives month as
JAN... SO, you need a
select * from schedule where to_char(SHDL_STRT_TIME,'dd-Mon-yy HH24:mi:ss') IN('11-Jan-15 20:30:00','11-Jan-15 08:00:00','11-Jan-15 20:00:00')
Finally, elegant solution could be,
select * from schedule where SHDL_STRT_TIME IN(:DATE1, :DATE2, :DATE3)
JDBC, bind the values using
Mon may not be
Jan is Non-American databases!!! Also, you might miss the index, if you perform
to_char() over it..