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: Valid Date funcation in Oracle ?

Re: Valid Date funcation in Oracle ?

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Wed, 21 Jul 1999 16:53:00 GMT
Message-ID: <3798fab2.12484291@inet16.us.oracle.com>


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.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Jul 21 1999 - 11:53:00 CDT

Original text of this message

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