Menu

#3 Tables with foreign keys fail to generate

open
Bug (17)
5
2011-10-23
2011-09-25
Lawson He
No

Table Movie.Information created before Movie.People when it references Movie.People

16823 [main] FATAL com.ibm.dg.DataGenerator - Failed to create 'Movie.Information' table,stopping generation.
Table CREATE statement used: CREATE TABLE Movie.Information( Movie_ID INTEGER NOT NULL, Person_ID INTEGER NOT NULL, Watched VARCHAR(1) NOT NULL, To_watch VARCHAR(1) NOT NULL, To_buy VARCHAR(1) NOT NULL, Owned VARCHAR(1) NOT NULL , PRIMARY KEY (Movie_ID,Person_ID) , FOREIGN KEY ( Person_ID) REFERENCES Movie.People( Person_ID) )

Discussion

  • Nikita

    Nikita - 2011-10-09
    • assigned_to: nobody --> lawsonhe
     
  • Lawson He

    Lawson He - 2011-10-23
    • summary: Tables not generated in correct order --> Tables with foreign keys fail to generate
     
  • Lawson He

    Lawson He - 2011-10-23

    If the tables are correctly sequence, tables with foreign keys will still fail to generate.

    Using the database config file attached, Test.A will generate, then Test.B will generate but Test.D will fail to generate.

    Here is the error message:
    27942 [main] FATAL com.ibm.dg.DataGenerator - Failed to create 'Test.D' table,stopping generation.
    Table CREATE statement used: CREATE TABLE Test.D( d_ID INTEGER NOT NULL , PRIMAR
    Y KEY (d_ID) , FOREIGN KEY ( d_ID) REFERENCES Test.A( d_ID) )
    27942 [Thread-0] WARN com.ibm.dg.DataGenerator - Shutting down.

    After connecting to the database manually, the create table statement used was executed and here is the resulting error message:

    db2 => CREATE TABLE Test.D( d_ID INTEGER NOT NULL , PRIMARY KEY (d_ID) , FOREIGN
    KEY ( d_ID) REFERENCES Test.A( d_ID) )
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0573N A column list specified in the references clause of constraint
    "D_ID..." does not identify a unique constraint of the parent table or
    nickname "TEST.A". SQLSTATE=42890

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.