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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to check if a date is a valid date in Oracle?

983611Jan 8 2013 — edited Jan 10 2013
Hello,
I have a date '0212-09-17', and it seems Oracle did accept it when I stored it in a table (column type = DATE).
However, when it was flowing downstream into other servers such as SQL server, it caused issues, because SQL treats it as an invalid date.
Then I added in a check to check if dates like the above is valid before flowing downstream.
But surprisingly if i use TO_DATE('0212-09-17, 'YYYY-MM-DD') it seems to return a valid date... but the year doesn't look right.
I did a bit of research on google, didn't find good answers on this. Can you tell me what would be the best way to check for
valid dates in Oracle?


Much appreciated,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2013
Added on Jan 8 2013
14 comments
15,166 views