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

checking the valid date string

From: <tentwenty_at_my-deja.com>
Date: Thu, 21 Dec 2000 07:06:58 GMT
Message-ID: <91sa6g$i41$1@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 - 01:06:58 CST

Original text of this message

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