Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 815
  • Last Modified:

LOAD and long date formats

Hello,

I'm experienced with databases but still new to DB2. I've been using the LOAD utility to load data and have done so successfully with dates of the form YYYY-MM-DD. Now I need to load data that contains dates in this format:

Mon DD, YYYY

Examples:

Jan 1, 2003
Jul 12, 2004

How do I do this?
0
yoren
Asked:
yoren
  • 3
  • 2
1 Solution
 
ghp7000Commented:
you will have to write either a UDF, a stored procedure or a c program to convert the date formats you have to valid dates. What is the source of your data, an excel data sheet?
0
 
yorenAuthor Commented:
Thanks for the response. So DB2 can't read that format natively? That's unfortunate. What's involved in writing a UDF (and what is it)? If I write one, will I be able to use the LOAD utility?

The source of the data is a proprietary database program. It can be made to export into YYYY-MM-DD, but the default is what I stated above. I was hoping to be able to handle the default format.
0
 
ghp7000Commented:
no, db2 cant read the format, your easiest solution is to export to YYYY-MM-DD format.
0
 
yorenAuthor Commented:
Yet another reason to use Oracle! Too bad I have no choice in the matter.
0
 
ghp7000Commented:
Well, its not such a big point, you can simply export the data from the source in the required format
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now