Results 1 to 8 of 8

Thread: rejecting rows

  1. #1
    Join Date
    Sep 2006
    Posts
    20

    Unanswered: rejecting rows

    When I copy a table, which has nullable columns, rows are rejected.
    How can I easily copy nullable columns?

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Please provide DB2 version, OS, DDL of source table, DDL of target table and SQL you are using to copy.

    Andy

  3. #3
    Join Date
    Sep 2006
    Posts
    20
    DB2 8.2
    OS win32
    I can copy all tables except tables which have nullable columns.
    first I couldnt copy tables which have auto generated identity but then using alter ....set generated by default db2command it is okey.But now can not copying nullable columns

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    How are you doing the copy. Please give specific detail. Your general description is not helpful. The DDl for the source, destination, and SQL you use to copy would help alot.

    Andy

  5. #5
    Join Date
    Sep 2006
    Posts
    20
    I'm copying tables from one db to another db by sending db2 commands to db2clp from my .net application.
    first I set the auto generate identity to generated by default by using alter command.
    then export table with export command.
    then import tables into new db with import command
    I need db2command to copy tables contains columns that are nullable.I get this from this error:

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

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

  6. #6
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by dhuygu
    SQL3550W The field value in row "1" and column "1" is not NULL, but the
    target column has been defined as GENERATED ALWAYS.
    Set it to "GENERATED ALWAYS BY DEFAULT"
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  7. #7
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You had a related question last week. Are you sure you are setting the identity on the destination properly, or are you doing that on the source. The message you are getting has to do with the column still being generate always. The nullable part has nothing to do with the message you are getting. What is the reason for the copy?

    Andy

  8. #8
    Join Date
    Sep 2006
    Posts
    20
    yer you are right.error is about aouto generate.it is okey now.thank you very much

Posting Permissions

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