Oracle之:Function :getdate()

来源:互联网 发布:看快穿小说的软件 编辑:程序博客网 时间:2024/05/17 02:21
create or replace function getdate(sp_date varchar) return date is  Result date;begin  if LENGTH(sp_date) =10 then    Result:=to_date(sp_date,'YYYY-MM-dd');  end if;  if LENGTH(sp_date) =8 then    Result:=to_date(sp_date,'YYYYMMdd');  end if;  return(Result);end getdate;