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

Home -> Community -> Usenet -> c.d.o.misc -> Re: update date filed in tables?

Re: update date filed in tables?

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Fri, 23 Apr 1999 17:41:40 +0200
Message-ID: <7fq4b8$b8t$1@weber.a2000.nl>


yliu wrote

> set thrudate = to_date('31-dec-2099', 'dd-mon-yyyy')
> where thrudate = to_date ('31-dec-99', 'dd-mon-yy') ;

Note that Oracle always stores four digits years. I'd prefer

    where thrudate = to_date ('31-dec-1999', 'dd-mon-yyyy') ;

but well, your code would work as well, unless thrudate could also contain a time part. Then use:

    set thrudate = to_date('31-dec-2099', 'dd-mon-yyyy')     where trunc(thrudate) = to_date ('31-dec-1999', 'dd-mon-yyyy') ;

or if performance is an issue and thrudate has an index (which I doubt as a lot of rows have the value set to 31-dec-1999):

    where thrudate between to_date ('31-dec-1999', 'dd-mon-yyyy')

        and to_date ('31-dec-1999 23:59:59', 'dd-mon-yyyy hh24:mi:ss');

Arjan. Received on Fri Apr 23 1999 - 10:41:40 CDT

Original text of this message

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