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

Home -> Community -> Mailing Lists -> Oracle-L -> WinNT / 8.0.5 / DECODE function affecting Century result in date

WinNT / 8.0.5 / DECODE function affecting Century result in date

From: George Hofilena <GHofilena_at_cnv.org>
Date: Tue, 11 Sep 2001 20:44:46 -0700
Message-ID: <F001.0038AA4A.20010911161224@fatcity.com>

List,

I have a 6-position column, bdate, in a text file that I am trying to SQL*Load formatted as yymmdd. When I use the following SQL operations I get the following results:

  1. SQL Operation: (bdate POSITION(001:006) CHAR
    "TO_DATE(:bdate,'YYMMDD')")
    Result in the database: Next Century, e.g. '300223' becomes '23-FEB-2030'
  2. SQL Operation (bdate POSITION(001:006) CHAR
    "DECODE(:bdate,NULL,NULL,TO_DATE('19'||:bdate,'YYYYMMDD'))")
    Result in the database: Next Century, e.g. '300223' becomes '23-FEB-2030'
but when I take out the DECODE in item 2, I get the correct century. I only use decode because there are null values in this column. Can somebody explain to me what I am missing here?

Thanks,

George

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: George Hofilena
  INET: GHofilena_at_cnv.org

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Sep 11 2001 - 22:44:46 CDT

Original text of this message

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