Toad World® Forums

Test data generator problem


#1

Hello

I am trying to load some test data to my tables, connected with foreign key.
I would like 1:M relationship so I set 10 records to be inserted in the parent table OW_XDB2
with primary key ID and 100 records to be inserde in the child table OW_YDB2 with primary key
ID, IDY and foreign key ID referencing ID in the table OW_XDB2. Test data generator automaticaly
set the value for ID in OW_YDB2 to be taken from OW_XDB2 and also I set IDY from OW_YDB2 to
be generated with sequence. The problem is that I get only 0 value for IDY and constraint violatio.

------Generating of data------

–1. --INSERT “DB2ADMIN”.“OW_XDB2”(“DATPOSEGA”, “ID”, “IME”, “PRIIMEK”)

INSERT

INTO “DB2ADMIN”.“OW_XDB2”

(“DATPOSEGA”, “ID”, “IME”, “PRIIMEK”)

VALUES (‘2013-03-26’, 91, ‘I’, ‘HUUHYH’);

INSERT

INTO “DB2ADMIN”.“OW_XDB2”

(“DATPOSEGA”, “ID”, “IME”, “PRIIMEK”)

VALUES (‘2007-06-26’, 0, ‘MFNCLY’, ‘ODXR’);

–2. --INSERT “DB2ADMIN”.“OW_YDB2”(“DATPOSEGA”, “ID”, “IDY”, “IME”, “PRIIMEK”)

INSERT

INTO “DB2ADMIN”.“OW_YDB2”

(“DATPOSEGA”, “ID”, “IDY”, “IME”, “PRIIMEK”)

VALUES (‘2001-04-15’, 29, 0, ‘YXPKO’, ‘DCJWOQM’);

INSERT

INTO “DB2ADMIN”.“OW_YDB2”

(“DATPOSEGA”, “ID”, “IDY”, “IME”, “PRIIMEK”)

VALUES (‘2013-02-12’, 0, 0, ‘YMWJ’, ‘ZDIGRAL’);

INSERT

INTO “DB2ADMIN”.“OW_YDB2”

(“DATPOSEGA”, “ID”, “IDY”, “IME”, “PRIIMEK”)

VALUES (‘2006-06-03’, 22, 0, ‘QNZA’, ‘SN’);

INSERT

INTO “DB2ADMIN”.“OW_YDB2”

(“DATPOSEGA”, “ID”, “IDY”, “IME”, “PRIIMEK”)

VALUES (‘2012-03-22’, 20, 0, ‘IBITJM’, ‘EA’);


#2

Hello Aci,

I recreated your problem and opened issue TDB-218 with development.

As a workaround if you remove the primary key from OW_YDB2 the data generator successfully generates sequential or random values for column IDY. After inserting the data you can restore the primary key.

I hope this helps,

Adam


#3

Hello Adam, thank you for your response. Hope the bug will be resolved soon

Regards!