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: checking the valid date string

Re: checking the valid date string

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 21 Dec 2000 09:24:30 +0100
Message-ID: <91sel6$3ukt4$1@ID-62141.news.dfncis.de>

The code you posted should work.
A simple assignment
<date_var > := to_date ...
should also end in an exception.
Please try to clarify your problem in more detail.

Regards,

Sybrand Bakker, Oracle DBA

<tentwenty_at_my-deja.com> wrote in message news:91sa6g$i41$1_at_nnrp1.deja.com...
> How can I check the validity of the string for to_date()? I have a
> procedure which has 3 varchar2's as it parameters, c_yy, c_mm, and
> c_dd, then I try to call
>
> to_date (c_mm || '.' || c_dd || '.' c_yy, 'mm.dd.yy')
>
> when the inputs are valid, it works like charm, but how can I check the
> out of range month and day parameters? month is easy, but what about
> the day? I tried to do a reasonable EXCEPTION catch, but the following
> won't work either.
>
> begin
> select to_date (c_mm || '.' || c_dd || '.' c_yy, 'mm.dd.yy')
> into d_date
> from dual;
> exception
> when others then
> -- do something here
> end;
>
> can anyone help?
>
> thanks in advance
>
>
>
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Thu Dec 21 2000 - 02:24:30 CST

Original text of this message

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