Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2013
    Posts
    2

    Unanswered: load data into generated always table

    Hi,

    I have two tables of same structure like below:

    TEST1 in db2 v9.5

    CREATE TABLE TEST1 (
    USER_ID VARCHAR(50)
    CREATED_TS TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP
    LAST_UPDATED_TS TIMESTAMP NOT NULL GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP)

    TEST2 in db2 v9.7

    CREATE TABLE TEST2 (
    USER_ID VARCHAR(50)
    CREATED_TS TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP
    LAST_UPDATED_TS TIMESTAMP NOT NULL GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP)


    Whne trying to do cursor load data from test1 to test2 its failing as

    SQL3526N The modifier clause "GENERATEDMISSING" is inconsistent with the
    current load command. Reason code: "3".

    tried with generatedoverride and generatedignore but it didnt work.

    Can someone please help to slove this issue.
    Last edited by carzydba; 06-03-13 at 03:10.

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    generatedmissing works when you have GENERATED BY DEFAULT. In your case, the column is defined as GENERATED ALWAYS, so you should use identityoverride / missing /ignore.
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  3. #3
    Join Date
    Jun 2013
    Posts
    2
    Tried with that even:mssing/override/ignore
    LOAD FROM mycurs OF cursor MODIFIED BY IDENTITYMISSING MESSAGES messages/load_TEST1.txt replace into TEST2 STATISTICS USE PROFILE NONRECOVERABLE LOCK WITH FORCE
    SQL3526N The modifier clause "IDENTITYMISSING" is inconsistent with the
    current load command. Reason code: "3".

  4. #4
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    My mistake: you don't have GENERATED ALWAYS AS IDENTITY.
    You should read this: loading in to generated row change timestamp column - DB2 Database
    but I think that you need rowchangetimestampoverride
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Tags for this Thread

Posting Permissions

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