Re: Date conversion question

  • From: "Gints Plivna" <gints.plivna@xxxxxxxxx>
  • To: Harvinder.Singh@xxxxxxxxxxxxx
  • Date: Thu, 4 Oct 2007 11:11:32 +0300

I'd say that there are two parts in this task:
1) Requirements/logical part.
Understand how to convert these in the first sight at least for me
unclear numbers into dates and write it down in a more or less formal
way without thinking whether it will or won't be Oracle, PL/SQL or
whatever. I.e. how to get year, how to get month, how to get day.
As others have pointed out there are at least some suspected cases.

2) Technical part.
Load your data into staging table and write some sql statement(-s) or
pls/sql procedure (if the algorithm is too complicated) to convert
these numbers to oracle dates.

Such process will help you once again understand and think about
conversion algorithm (abstracting from the exact implementation
details) and also you can show it to somebody that can approve it :)

Gints Plivna

2007/10/3, Harvinder Singh <Harvinder.Singh@xxxxxxxxxxxxx>:
> 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
> --

Other related posts: