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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Date conversion question

Re: Date conversion question

From: August Spier <gspier_at_chiliad.com>
Date: Wed, 3 Oct 2007 17:45:12 -0400
Message-Id: <E63BEDF7-DE95-49BB-BDDB-2E05B4A0AC60@chiliad.com>


Harvinder,

It's a multi-step process. First load the data into a column of type "char" (CHAR_COL). Second, add a column of type "date" (DATE_COL). Third, analyze the values you have. Fourth, build the PL/SQL (or any other programming to you prefer) to update each row setting the DATE_COL to be TO_DATE(CHAR_COLUMN,'<date format of your choice>') based on the value in CHAR_COL. (If length(CHAR_COL) = 6 AND SUBSTR (CHAR_COL,1,2)=99 THEN ... r and good luck,

Gus

On Oct 3, 2007, at 3:44 PM, Harvinder Singh wrote:

> Hi,
>
> We have a flat file that contains a column and the values are
> stored as:
> 991123
> 421
> 60823
> 0
> 70930
>
> Now we are moving data from flat file to table and this column will be
> inserted into Date dataype column, What is the way to insert into this
> table and avoid "ORA-01821: date format not recognized" errors.
>
> Thanks
> --Harvinder
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Oct 03 2007 - 16:45:12 CDT

Original text of this message

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