I want to write a Oracle SQL select statement that tells if it could parse a date string in the given format by returning a code - zero on failure (exception) and a positive number in case of success :
SELECT
CASE
WHEN PARSING SUCCESSFUL (ie. to_date('1-Jan-2001','dd-mon-yy') succeeds) THEN 1
ELSE 0
END
FROM DUAL;
How do I write this ? If the parsing fails, will the ELSE condition return a value ? I need to do all these checks in the SELECT statement itself. Please help.
Thanks Dileep