判断日期格式是否合法
2020-04-02 本文已影响0人
南谭一隅
/*
判断日期格式是否合法,合法返回1,不合法返回0
*/
create function check_date(i_dt varchar2) return number is
v_dt date;
begin
v_dt := to_date(i_dt, 'yyyy-mm-dd');
return 1;
exception
when others then
return 0;
end check_date;