Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Valid Date funcation in Oracle ?
On Wed, 21 Jul 1999 16:47:11 GMT, "John Geiger" <jgeiger_at_rhs.org> wrote:
>Does anyone know if there a way to check a character string, before moving
>it into a date field, to see if it is a valid date?
You could write a function like...
create or replace
function is_date(
p_date varchar2,
p_format varchar2 default 'DD-MON-YY' ) return boolean is
--
l_date date;
begin
l_date := to_date( p_date, p_format );
return true;
exception
when others then
return false;
end;
/
hope this helps.
chris.
>
--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.