Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is Date:

Re: Is Date:

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 5 Oct 2001 19:22:25 +0200
Message-ID: <trrrtr8rddul68@news.demon.nl>

"Allan Martin" <allan.martin_at_saic.com> wrote in message news:3bbd29aa_at_cpns1.saic.com...
> Does anyone know of an IS_Date function or similar, where I could send it
a
> string and if it was in a date format, it would return true or false if
not?
>
> Allan
>
>

There is not .
You can however very easily write it.

create or replace function is_date (datestr in varchar2) return number is dummy date;
begin
dummy := to_date(datestr,'formatmask');
return 1 ; -- meaning true
exception when others
then
 return 0; -- meaning false
end;
/

This is all you need

Please refrain from excessive crossposting

Hth,

Sybrand Bakker, Senior Oracle DBA Received on Fri Oct 05 2001 - 12:22:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US