Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2010
    Posts
    32

    Unanswered: timestamp format mismatch

    I am trying to load data from a flat file which fails due to timestamp format mismatch

    Code:
    create table test (cr_dt timestamp );
    
    Test data :- 
    7/30/2014 1:26:00
    8/11/2014 0:10:00
    8/1/2014  0:01:00
    
    import from test.csv of del MODIFIED BY timestampformat="MM/DD/YYYY HH:MM:SS" INSERT INTO TEST;

    all the rows are rejected with the following error message :-
    Code:
    SQL3191N  The field in row "1", column "1" which begins with "7/30/2014
    1:26:00" does not match the user specified DATEFORMAT, TIMEFORMAT, or
    TIMESTAMPFORMAT. The row will be rejected
    Need help in importing the data with the timestamp format

    Thanks
    lazy

  2. #2
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    Try M/D/YYYY H:M (single letter M (etc) which allows one or two digits (while MM etc requires two digits)).

  3. #3
    Join Date
    Mar 2010
    Posts
    32
    no luck with single letters

  4. #4
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    Post your db2-version, fixpack, operating-sytem.
    In your test data there is an extra space between the year and hour on the third line and so the data does not match the format "M/D/YYYY H:MMS" (so that line is rejected while the other lines correctly import).
    Choose a format and ensure the data matches that format...
    Alternative approaches exist, some preprocessing is possible with ingest, or preprocess before import, or postprocess after import.
    Last edited by db2mor; 03-13-15 at 06:15.

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    as doc indicates
    M Month (one or two digits ranging from 1 - 12)
    MM Month (two digits ranging from 01 - 12; mutually exclusive with M
    if MM always 2 digits expected - with M leading zero is not expected
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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