Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am trying to export + import data from a table in a db2 database to another. But while running the export command I am getting the following error.

SQL3550W The field value in row "26" and column "17" is not NULL, but the target column has been defined as GENERATED ALWAYS.

and

SQL3185W The previous error occurred while processing data from row "26" of the input file.

Why is this error coming and how can I fix it.

The Table

CREATE TABLE COMPANY_CLIENT (
        CLIENTGUID CHAR(36) NOT NULL,
        TYPECODE VARCHAR(2) NOT NULL,
        COMPANYNAME VARCHAR(150),
        LASTNAME VARCHAR(150),
        FIRSTNAME VARCHAR(150),
        MIDDLEINITIAL VARCHAR(150),
        PREFIX VARCHAR(10),
        SUFFIX VARCHAR(10),
        SEX VARCHAR(10),
        DATEOFBIRTH TIMESTAMP,
        DATEOFDEATH TIMESTAMP,
        TAXID VARCHAR(60),
        EMAIL VARCHAR(300),
        XMLDATA CLOB(1073741824) INLINE LENGTH 276,
        UPDATEDGMT TIMESTAMP,
        LEGALRESIDENCECOUNTRYCODE VARCHAR(3),
        LASTNAME_LOWER VARCHAR(150) GENERATED ALWAYS AS ((LOWER(LASTNAME))),
        FIRSTNAME_LOWER VARCHAR(150) GENERATED ALWAYS AS ((LOWER(FIRSTNAME))),
        COMPANYNAME_LOWER VARCHAR(150) GENERATED ALWAYS AS ((LOWER(COMPANYNAME))),
        TAXID_LOWER VARCHAR(60) GENERATED ALWAYS AS ((LOWER(TAXID))),
        ALTERNATENAME1 VARCHAR(150),
        ALTERNATENAME2 VARCHAR(150),
        ALTERNATENAME3 VARCHAR(150),
        ALTERNATENAME4 VARCHAR(150),
        ALTERNATENAME5 VARCHAR(150),
        ADDITIONALPREFIX VARCHAR(10),
        ADDITIONALSUFFIX VARCHAR(10),
        TAXIDTYPE VARCHAR(10),
        TITLE VARCHAR(10),
        MARITALSTATUS VARCHAR(10),
        BIRTHCOUNTRYCODE VARCHAR(3),
        CITIZENSHIPCOUNTRYCODE VARCHAR(3),
        BIRTHREGIONCODE VARCHAR(10),
        PRIMARYPHONE VARCHAR(60),
        TEXTFIELD1 VARCHAR(765),
        TEXTFIELD2 VARCHAR(765),
        CHECKBOX1 VARCHAR(9),
        CHECKBOX2 VARCHAR(9),
        RADIO1 VARCHAR(10),
        RADIO2 VARCHAR(10),
        COMBO1 VARCHAR(10),
        COMBO2 VARCHAR(10),
        DATE1 TIMESTAMP,
        DATE2 TIMESTAMP
    )
share|improve this question
add comment

migrated from stackoverflow.com Apr 22 '13 at 12:17

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 2 down vote accepted

Using the same IXF files created by db2move export, you can manually load the data using db2 import with the MODIFIED BY IDENTITYOVERRIDE parm for those tables that require it.

share|improve this answer
add comment

The columns marked GENERATED ALWAYS are derived columns that are automatically generated from other columns. You cannot manually set a value to a column that is generated automatically.

One solution is to only import the columns that are not GENERATED ALWAYS. There may be another way to load the data without obeying column constraints (perhaps LOAD?), but I am not sure about this (the documentation is not clear), and it likely depends on your version of DB2.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.