Data Generator

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
m227
Posts: 75
Joined: Mon 06 Aug 2007 12:41

Data Generator

Post by m227 » Thu 17 Mar 2016 13:31

I just downloaded dbForge Data Generator to give it a try.
And the first simple function I cannot get is to use another table data without populating it.

I have two tables:

Code: Select all

 a(id INT PRIMARY KEY, name VARCHAR(64));
 b(id INT PRIMARY KEY, a_id INT NOT NULL, FOREIGN KEY (a_id) REFERENCES a(id));
I already have some data in table a and they are valid. I just want to populate table b with some random data maintaining FK constraints.

When I check table b in a generator it shows red x at column a_id telling that "column refers to id column of a which is not included of data generation". So I add a table to fulfill requirement. Then I cannot set "Number of rows to generate" in the table a just to 0 (to use only data which is already in the table). How to do that?

Michal

alexa

Re: Data Generator

Post by alexa » Fri 18 Mar 2016 14:51

This can be achieved as follows:

1. Leave all the columns of the table 'a' unselected.
2. Select the 'a_id' column of the table 'b'. The other column 'id' will be selected automatically.
3. Select 'Table or View - loads column data of a compatible type from a table or view' in the 'Generator' menu.
4. Specify the 'Connection' and 'Database' fields.
5. Select the 'Table' radio-button.
6. Select the table 'a' against the 'Table' radio-button.
7. Start data generation.

m227
Posts: 75
Joined: Mon 06 Aug 2007 12:41

Re: Data Generator

Post by m227 » Tue 22 Mar 2016 14:30

Dear Alexa,
Ad. 2. Unfortunately column id is not selected automatically in first table when I select a_id in second.

When I check a.id manually i get exclamation mark in a yellow triangle with a comment:
The column containing 'not null' and having no default value excluded from data generation.
which is ridiculous as it is auto incremented. My definition of a.id is:

Code: Select all

id INT NOT NULL AUTO_INCREMENT PRIMARY KEY

alexa

Re: Data Generator

Post by alexa » Tue 22 Mar 2016 15:21

Ad. 2. Unfortunately column id is not selected automatically in first table when I select a_id in second.
That's right, the column 'id' in the table 'a' shouldn't select automatically. Instead, the column 'id' in the table 'b' gets selected automatically. So, as a result you should have selected both the columns of the table 'b', whereas the columns of the table 'a' should be left unselected.
The column containing 'not null' and having no default value excluded from data generation.
This message relates to the column b.a_id which is unselected in your case.

m227
Posts: 75
Joined: Mon 06 Aug 2007 12:41

Re: Data Generator

Post by m227 » Wed 23 Mar 2016 14:31

Dear Alexa,
After many trials and errors I almost managed it.
I select b.a_id and then setup "Table or View" as you suggested. And it seems to work, however at my case when I try to use default values when generating I get error:
"Access to the path 'C:\Users\me\AppData\Local\Temp\dbForge Data Generator for MySQL\16c56.... is denied."

alexa

Re: Data Generator

Post by alexa » Thu 24 Mar 2016 16:22

This happens due to lack of permissions for the specified folder.

To resolve this, you have to redefine the temp folder to the one you have permissions for. This can be achieved by creating and executing a *.reg file with the following content:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Devart\dbForge Data Generator for MySQL\Options\DataComparisonCommon]
"UseCustomCacheFolder"="True"
"CacheFolder"="c:\\my temp_folder"

alexa

Re: Data Generator

Post by alexa » Wed 06 Apr 2016 16:27

We would like to let you know that the feature you were referring to is now implemented in the new version 1.6 of dbForge Data Generator for MySQL https://www.devart.com/dbforge/mysql/da ... nload.html

It can be setup as follows:

1. Select 'Tools -> Options...' from the main menu. The 'Options' window opens.
2. Navigate to the 'Data Generation -> General' branch.
3. Select the 'Custom Folder' option in the 'Cache Folder' section and specify a folder.

Thank you for your help in improving dbForge Data Generator for MySQL.

Post Reply