Page 1 of 1

Data Generator - Foreign Keys

Posted: Mon 24 May 2021 05:18
by cdunn66
Trying to generate values for a data table which has a column which is a foreign key to a status table.

Now the status table is already pre-populated but for some reason the data generation for the data table won't refer to this table but insists that we also generate data for this status table within the tool.

Do you know how I can tell the tool to read from the database rather than insisting on creating this data itself.

Re: Data Generator - Foreign Keys

Posted: Mon 24 May 2021 08:06
by dzhanhira
It is necessary for such columns under Foreign Key to use not a Foreign Key generator, but a Table Or View generator.
In this case, the generator will take values for the table's children from the existing dataset in the parent one.

Re: Data Generator - Foreign Keys

Posted: Tue 25 May 2021 05:22
by cdunn66
Many thanks for this response. Yes, I have converted my generator to use Tables and not Foreign Keys in these instances and it works a treat now.