美文网首页
判断日期格式是否合法

判断日期格式是否合法

作者: 南谭一隅 | 来源:发表于2020-04-02 13:54 被阅读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;

相关文章

网友评论

      本文标题:判断日期格式是否合法

      本文链接:https://www.haomeiwen.com/subject/orlxphtx.html