Search code examples
db2ibm-clouddb2-luw

Lift load Dateformat issue from csv file


we are migrating db2 data to db2 on cloud. We are using below lift cli operation for migration.

    1. Extracting a database table to a CSV file using lift extract from source database.
    1. Then loading the extracted CSV file to db2 on cloud using 'lift load'

ISSUE:

We have created some tables using ddl on the target db2oncloud which have some columns with DATA TYPE "TIMESTAMP" while load operation(lift load), we are getting below error"

"MESSAGE": "The field in row \"2\", column \"8\" which begins with \"\"2018-08-08-04.35.58.597660\"\" does not match the user specified DATEFORMAT, TIMEFORMAT, or TIMESTAMPFORMAT. The row will be rejected.", "SQLCODE": "SQL3191W"


Solution

  • If you use db2 as a source database, then use either:

    • the following property during export (to export dates, times, timestamps as usual for db2 utilities - without double quotes):

    source-database-type=db2

    • try to use the following property during load, if you have already exported timestamps surrounded by double quotes:

    timestamp-format="YYYY-MM-DD-HH24.MI.SS.FFFFFF"