Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    155

    Unanswered: LOAD command --> dateformat

    Hallo everyone,

    I tried to load a csv file with this following date format:

    recordline1;08.10.2012 ;recordline1
    ....
    ....
    ....
    recordlinex;08.10.2012 ;recordlinex

    As we can see, the date format is not smooth:
    ;08.10.2012 ;

    I would like to load the csv file and transfer this the dates in ISO-format. So I try this:

    Code:
    modified by dateformat=\"YYYY-MM-DD\"
    But it didnt work
    Can DB2 do trimming for itself? Or the problem is somewhere else?

    Thank you.

    Regards,
    Ratna

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by ratnalein View Post
    I would like to load the csv file and transfer this the dates in ISO-format. So I try this:

    Code:
    modified by dateformat=\"YYYY-MM-DD\"
    You must be joking.

    Quote Originally Posted by TheF...Manual
    dateformat="x" x is the format of the date in the source file
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    May 2012
    Posts
    155
    Hallo n_i,

    I am not joking. I tried this:

    Code:
    modified by dateformat="YYYY-MM-DD"
    But it didnt work.

    Thank you.

    Regards,
    Ratna

  4. #4
    Join Date
    May 2012
    Posts
    155
    ah okay.. it must be:

    Code:
    modified by=\"DD-MM-YYYY\"
    But I wonder, in which format db2 will transfer this format in the database?

    Regards,
    Ratna

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Depends on the target data type. If it's DATE, it has no format, it's just a number. If it is a character type, it will be stored as entered (loaded).
    ---
    "It does not work" is not a valid problem statement.

  6. #6
    Join Date
    May 2012
    Posts
    155
    okay, that is nice. thank you for the information.

    Regards,
    Ratna

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •