Date Format
Moderators: chulett, rschirm, roy
Date Format
I have tab delimited source file from that i am getting the date column in the format "dd-mon-yy" or "d-mon-yy" but, i need to load into oracle table with the default format. Plz help me how to achieve this.
NJ
First, what is the datatype of the table column you will be loading the date into?
Date formats and loading dates into Databases has been discussed and resolved many times in the forum. Please take a little time to use the search function!
Regards,
Date formats and loading dates into Databases has been discussed and resolved many times in the forum. Please take a little time to use the search function!
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Premium Member
- Posts: 72
- Joined: Mon Jul 06, 2009 9:34 pm
- Location: Sydney
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's no such thing as a default format for Oracle. You set your own date picture (or the DBA may have done it for you). Let's assume it's YYYY-MM-DD, which is also the ISO 8601 standard.
You now have two problems - how to correctly add the century to your two digit years, and how to reorder the components converting an alphabetic month to a numeric representation.
Use two StringToDate() conversion, one for each of your formats, governed by If..Then..Else to decide which format to convert, and providing an appropriate format string for each.
Once the internal data type is Date, the Oracle Connector should handle it gracefully.
You now have two problems - how to correctly add the century to your two digit years, and how to reorder the components converting an alphabetic month to a numeric representation.
Use two StringToDate() conversion, one for each of your formats, governed by If..Then..Else to decide which format to convert, and providing an appropriate format string for each.
Once the internal data type is Date, the Oracle Connector should handle it gracefully.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.