In 11g, you have a built in function named ISDATE to check whether a given value is a valid date or not.
In the earlier versions, we can achieve a similar thing using user defined functions.
A simple function like this will do:
Now run this query to find out which are all invalid records:
select * from urtable
where isdate(datecol) = 1
Main Topics
Browse All Topics





by: sdstuberPosted on 2009-03-29 at 22:41:42ID: 24016202
If this is oracle 10g or higher then you've pretty much already got it
1-9]|1[012 ])/(0?[1-9 ]|[12][0-9 ]|3[01])/( 19|20)\d\d ')
select * from invoice where not regexp_like(due_date,'(0?[
if it's 9i or lower then regular expressions aren't supported
you'll have to write your own function then
try somthing like this...
select * from invoice where check_date_str(due_date) is null
Select allOpen in new window