Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using CAST function to convert to timestamp

user588212Sep 22 2008 — edited Sep 22 2008
I have a select statement that runs via JDBC and is not using any index as timestamp is explicitly used. I would like to be able to convert to Date so the proper index can be used as this column is of Date datatype. I'm having "ORA-25137: Data value out of range" when I use "b.TRAN_DATE BETWEEN CAST(:1 AS DATE) AND CAST(:2 AS DATE) : instead of "b.TRAN_DATE BETWEEN :a and :b.

Could someone help with this as I really want our indexes to be used and therefore Date datatype should be used in the JDBC connection

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2008
Added on Sep 22 2008
4 comments
508 views