I would like to check if my date value is in the correct format and also the year is after 1999. So, if a date is in 1999 then it will be flagged. The date is in the following format dd-mmm-yyyy (example: 03-APR-2019).
flag_coll_date := '';
if coll_date is defined and coll_date ne '' then
coll_date1 := datetext(coll_date);
if coll_date1 rlike '^(([0-9])|([0-2][0-9])|([3][0-1]))\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\-\(([2][0][0-9][0-9]))\$'
then flag_coll_date := flag_coll_date;
else flag_coll_date := flag_coll_date.' coll_date';
end if;
else flag_coll_date := flag_coll_date.' coll_date';
end if;
Below is the error message that I received for the code I wrote above:
line 45, Error parsing expression in the LIKE clause: mismatched parenthesis
I will appreciate any inputs. Thanks!