Welcome to EMS Data Generator!

EMS Data Generator for DB2 is a powerful utility for generating test data into one or several DB2 database tables simultaneously, with script saving and editing capabilities. The wizard application allows you to define tables and columns for generating data, set value ranges, generate string values by mask, load values for BLOB columns directly from files, set lists of values manually, get sets of values from SQL queries and perform other operations with test date in a simple and direct way. The distribution of the utility also provides you with the console application which allows you to generate data in one-touch by using data generation templates.

Visit our web-site: https://www.sqlmanager.net for details.

Key features

  • Unicode support
  • Localizable user-friendly wizard interface
  • Ability to save and edit data generation script, without actual script execution
  • Generating data into several tables of different schemas
  • Support for all DB2 data types including user-defined types
  • Various data generation modes for each data type including list, random, incremental data generation and more
  • Ability to use SQL query results as the list of values for data generation
  • Ability to get data from another column for data generation
  • Ability to preview the data grid for each table
  • Automatic control over referential integrity for data generation into linked tables
  • Wide variety of generation parameters for each data type
  • Ability to set NULL values for a specified percent of cases
  • Ability to empty tables before data generation
  • Possibility of saving all the generation parameters specified within the current wizard session
  • The command-line utility to generate data using the configuration file

Product information

Homepage: | https://www.sqlmanager.net/products/db2/datagenerator
Support Ticket System: | https://www.sqlmanager.net/support
Register online at: | https://www.sqlmanager.net/products/db2/datagenerator/buy


What's new

Version | Release Date
Data Generator for DB2 4.0 | November 21, 2023

What's new in EMS Data Generator 4.0?

  • Support for dark visual theme added.

whats new dark scheme

  • Unicode names of objects are now supported.
  • Support for Windows 11 ARM added.
  • Encoding option for script file has been added.
  • Files with test data are now supplied with the program installation pack.
  • Many other improvements and fixes.

See also:

Version history


System requirements

System requirements for Data Generator for DB2

  • Microsoft Windows XP, Microsoft Windows Server 2003, Microsoft Windows Server 2008, Microsoft Windows Server 2008 R2, Microsoft Windows Server 2012, Microsoft Windows Server 2012 R2, Microsoft Windows Server 2016, Microsoft Windows Vista, Microsoft Windows 7, Microsoft Windows 8/8.1, Microsoft Windows 10, Microsoft Windows 11
  • 50MB of available HD space for program installation
  • DB2 Run-Time/Administrative Client 8.0 or higher
  • IBM® DB2 Connect (in case of using z/Series, iSeries, pSeries platform servers)


Installation

If you are installing Data Generator for DB2 for the first time on your PC:

  • download the Data Generator for DB2 distribution package from the download page available at our site;
  • unzip the downloaded file to any local directory, e.g. C:\unzipped;
  • run DB2DataGenSetup.exe from the local directory and follow the instructions of the installation wizard;
  • after the installation process is completed, find the Data Generator shortcut in the corresponding group of Windows Start menu.

If you want to upgrade an installed copy of Data Generator for DB2 to the latest version:

  • download the Data Generator for DB2 distribution package from the download page available at our site;
  • unzip the downloaded file to any local directory, e.g. C:\unzipped;
  • close Data Generator application if it is running;
  • run DB2DataGenSetup.exe from the local directory and follow the instructions of the installation wizard.

See also:

System requirements


Registration

All purchases are provided by Digital River registration service. The Digital River order process is protected via a secure connection and makes on-line ordering by credit/debit card quick and safe.

Digital River is a global e-commerce provider for software and shareware sales via the Internet. It accepts payments in US Dollars, Euros, Pounds Sterling, Japanese Yen, Australian Dollars, Canadian Dollars or Swiss Franks by Credit Card (Visa, MasterCard/EuroCard, American Express, Diners Club), Bank/Wire Transfer, Check or Cash.

If you want to review your order information, or you have questions about ordering or payments please visit our Customer Care Center, provided by Digital River.

Please note that all of our products are delivered via ESD (Electronic Software Delivery) only. After purchase you will be able to immediately download the registration keys or passwords. Also you will receive a copy of registration keys or passwords by email. Please make sure to enter a valid email address in your order. If you have not received the keys within 2 hours, please, contact us at sales@sqlmanager.net.

To obtain MORE INFORMATION on this product, visit us at https://www.sqlmanager.net/products/db2/datagenerator

Product distribution | MyCommerce/Digital River
EMS Data Generator for DB2 (Business license) + 1-Year Maintenance* | Register Now!
EMS Data Generator for DB2 (Business license) + 2-Year Maintenance*
EMS Data Generator for DB2 (Business license) + 3-Year Maintenance*
EMS Data Generator for DB2 (Non-commercial license) + 1-Year Maintenance*
EMS Data Generator for DB2 (Non-commercial license) + 2-Year Maintenance*
EMS Data Generator for DB2 (Non-commercial license) + 3-Year Maintenance*
EMS Data Generator for DB2 (Trial version) | Download Now!

*EMS Maintenance Program provides the following benefits:

  • Free software bug fixes, enhancements, updates and upgrades during the maintenance period
  • Free unlimited communications with technical staff for the purpose of reporting Software failures
  • Free reasonable number of communications for the purpose of consultation on operational aspects of the software

After your maintenance expires you will not be able to update your software or get technical support. To protect your investments and have your software up-to-date, you need to renew your maintenance.

You can easily reinitiate/renew your maintenance with our on-line, speed-through Maintenance Reinstatement/Renewal Interface. After reinitiating/renewal you will receive a confirmation e-mail with all the necessary information.

See also:

How to register EMS Data Generator


How to register Data Generator

To register your newly purchased copy of EMS Data Generator for DB2, perform the following:

  • receive the notification letter from Digital River with the registration info;
  • enter the Registration Name and the Registration Key from this letter;
  • make sure that the registration process has been completed successfully – check the registration information at the startup page.

Welcome to EMS Data Generator - Register product

See also:

Registration


Version history

Product name | Version | Release date
Data Generator for DB2 | Version 3.0.1.3 | December 17, 2012
Data Generator 2005 for DB2 | Version 2.3.0.1 | February 7, 2007

Full version history is available at https://www.sqlmanager.net/products/db2/datagenerator/news.

Version 3.0.1.3

  • Implemented Unicode support
  • Added options for data generation to SQL script: appending to an existing file; viewing/editing script
  • Added options for generating the same data into several columns
  • Added options for generating string data according to sample text
  • Implemented data preview
  • Added options for generating data into dependent fields related as 1:n (n records will be generated into the dependent table field for each record of the primary table)
  • Implemented data generation into fields of user-defined types
  • Data generation is now performed within a separate thread
  • Other minor improvements and bug-fixes

Scroll to top

Version 2.3

  • Wizard interface has become more user-friendly
  • The 'Commit every' option added
  • Added the ability to load the list of values from TXT and CSV files
  • The console version creates log files now
  • System tables are not displayed any more
  • Increased generation speed for string fields
  • Added the 'Clear tables before generation' option
  • Implemented encrypted passwords storage
  • Increased data generation speed
  • Improved data generation for tables with Foreign keys
  • Minor bug-fixes and improvements

Scroll to top

See also:

What's new


EMS Data Generator FAQ

Please read this page attentively if you have questions about EMS Data Generator for DB2.

Table of contents

  • What is Data Generator for DB2?
  • What do I need to start working with EMS Data Generator for DB2?
  • What is the easiest way to configure the template files for the console application of Data Generator?
  • How can I register the product?
  • Are there any limitations implied in the trial version as compared with the full one?

Question/answer list

Q: What is Data Generator for DB2?

A: Data Generator for DB2 is a powerful utility for generating test data to several DB2 database tables at once. The wizard application allows you to define tables for generating data, set value ranges, generate char and BLOB values, and many other features to generate test data in a simple and direct way. The utility also provides you with the console application which allows you to generate data in one touch by using generation templates.

Q: What do I need to start working with EMS Data Generator for DB2?

A: First of all you must have a possibility to connect to some local or remote DB2 server to work with Data Generator for DB2. You can use the following link to download the server and/or client: https://www.ibm.com/products/db2. Besides, you need your computer to satisfy the system requirements for Data Generator for DB2.

Q: What is the easiest way to configure the template files for the console application of Data Generator?

A: You can configure the template files for each table or export type visually using the DB2 Data Generator wizard. Set the required generation options at Step 4 of the wizard, click the 'Tools' button and select the 'Save Template' popup menu item. All the options will be saved to the template file which can be used later in the console application.

Q: How can I register the product?

A: If you have already purchased Data Generator for DB2, you can register the product by entering the appropriate registration information. Please refer to Registration and How to register EMS Data Generator for details.

Q: Are there any limitations implied in the trial version as compared with the full one?

A: The trial version of the utility admits to the maximum of 100 records to be generated at a time. In all other respects it does not differ from the full version as far as the functionality is concerned. That is, you can test all the features implemented in Data Generator for DB2 within the 30-day trial period.

Scroll to top

If you have any additional questions, contact us at our Support Center.


Other EMS Products

Quick navigation

MySQL

Microsoft SQL Server

PostgreSQL

InterBase / FireBird

Oracle

IBM DB2

Tools & components

MySQL

 | SQL Management Studio for MySQL EMS SQL Management Studio for MySQL is a complete solution for database administration and development. SQL Studio unites the must-have tools in one powerful and easy-to-use environment that will make you more productive than ever before!
 | SQL Manager for MySQL Simplify and automate your database development process, design, explore and maintain existing databases, build compound SQL query statements, manage database user rights and manipulate data in different ways.
dataexport | Data Export for MySQL Export your data to any of 20 most popular data formats, including MS Access, MS Excel, MS Word, PDF, HTML and more.
dataimport | Data Import for MySQL Import your data from MS Access, MS Excel and other popular formats to database tables via user-friendly wizard interface.
datapump | Data Pump for MySQL Migrate from most popular databases (MySQL, PostgreSQL, Oracle, DB2, InterBase/Firebird, etc.) to MySQL.
datagenerator | Data Generator for MySQL Generate test data for database testing purposes in a simple and direct way. Wide range of data generation parameters.
dbcomparer | DB Comparer for MySQL Compare and synchronize the structure of your databases. Move changes on your development database to production with ease.
extract | DB Extract for MySQL Create database backups in the form of SQL scripts, save your database structure and table data as a whole or partially.
query | SQL Query for MySQL Analyze and retrieve your data, build your queries visually, work with query plans, build charts based on retrieved data quickly and more.
datacomparer | Data Comparer for MySQL Compare and synchronize the contents of your databases. Automate your data migrations from development to production database.
 | Scroll to top

Microsoft SQL Server

 | SQL Management Studio for SQL Server EMS SQL Management Studio for SQL Server is a complete solution for database administration and development. SQL Studio unites the must-have tools in one powerful and easy-to-use environment that will make you more productive than ever before!
 | EMS SQL Backup for SQL Server Perform backup and restore, log shipping and many other regular maintenance tasks on the whole set of SQL Servers in your company.
sqladmin | SQL Administrator for SQL Server Perform administrative tasks in the fastest, easiest and most efficient way. Manage maintenance tasks, monitor their performance schedule, frequency and the last execution result.
 | SQL Manager for SQL Server Simplify and automate your database development process, design, explore and maintain existing databases, build compound SQL query statements, manage database user rights and manipulate data in different ways.
dataexport | Data Export for SQL Server Export your data to any of 20 most popular data formats, including MS Access, MS Excel, MS Word, PDF, HTML and more
dataimport | Data Import for SQL Server Import your data from MS Access, MS Excel and other popular formats to database tables via user-friendly wizard interface.
datapump | Data Pump for SQL Server Migrate from most popular databases (MySQL, PostgreSQL, Oracle, DB2, InterBase/Firebird, etc.) to Microsoft® SQL Server™.
datagenerator | Data Generator for SQL Server Generate test data for database testing purposes in a simple and direct way. Wide range of data generation parameters.
dbcomparer | DB Comparer for SQL Server Compare and synchronize the structure of your databases. Move changes on your development database to production with ease.
extract | DB Extract for SQL Server Create database backups in the form of SQL scripts, save your database structure and table data as a whole or partially.
query | SQL Query for SQL Server Analyze and retrieve your data, build your queries visually, work with query plans, build charts based on retrieved data quickly and more.
datacomparer | Data Comparer for SQL Server Compare and synchronize the contents of your databases. Automate your data migrations from development to production database.
 | Scroll to top

PostgreSQL

 | SQL Management Studio for PostgreSQL EMS SQL Management Studio for PostgreSQL is a complete solution for database administration and development. SQL Studio unites the must-have tools in one powerful and easy-to-use environment that will make you more productive than ever before!
 | EMS SQL Backup for PostgreSQL Creates backups for multiple PostgreSQL servers from a single console. You can use automatic backup tasks with advanced schedules and store them in local or remote folders or cloud storages
 | SQL Manager for PostgreSQL Simplify and automate your database development process, design, explore and maintain existing databases, build compound SQL query statements, manage database user rights and manipulate data in different ways.
dataexport | Data Export for PostgreSQL Export your data to any of 20 most popular data formats, including MS Access, MS Excel, MS Word, PDF, HTML and more
dataimport | Data Import for PostgreSQL Import your data from MS Access, MS Excel and other popular formats to database tables via user-friendly wizard interface.
datapump | Data Pump for PostgreSQL Migrate from most popular databases (MySQL, SQL Server, Oracle, DB2, InterBase/Firebird, etc.) to PostgreSQL.
datagenerator | Data Generator for PostgreSQL Generate test data for database testing purposes in a simple and direct way. Wide range of data generation parameters.
dbcomparer | DB Comparer for PostgreSQL Compare and synchronize the structure of your databases. Move changes on your development database to production with ease.
extract | DB Extract for PostgreSQL Create database backups in the form of SQL scripts, save your database structure and table data as a whole or partially.
query | SQL Query for PostgreSQL Analyze and retrieve your data, build your queries visually, work with query plans, build charts based on retrieved data quickly and more.
datacomparer | Data Comparer for PostgreSQL Compare and synchronize the contents of your databases. Automate your data migrations from development to production database.
 | Scroll to top

InterBase / Firebird

 | SQL Management Studio for InterBase/Firebird EMS SQL Management Studio for InterBase and Firebird is a complete solution for database administration and development. SQL Studio unites the must-have tools in one powerful and easy-to-use environment that will make you more productive than ever before!
 | SQL Manager for InterBase/Firebird Simplify and automate your database development process, design, explore and maintain existing databases, build compound SQL query statements, manage database user rights and manipulate data in different ways.
dataexport | Data Export for InterBase/Firebird Export your data to any of 20 most popular data formats, including MS Access, MS Excel, MS Word, PDF, HTML and more
dataimport | Data Import for InterBase/Firebird Import your data from MS Access, MS Excel and other popular formats to database tables via user-friendly wizard interface.
datapump | Data Pump for InterBase/Firebird Migrate from most popular databases (MySQL, SQL Server, Oracle, DB2, PostgreSQL, etc.) to InterBase/Firebird.
datagenerator | Data Generator for InterBase/Firebird Generate test data for database testing purposes in a simple and direct way. Wide range of data generation parameters.
dbcomparer | DB Comparer for InterBase/Firebird Compare and synchronize the structure of your databases. Move changes on your development database to production with ease.
extract | DB Extract for InterBase/Firebird Create database backups in the form of SQL scripts, save your database structure and table data as a whole or partially.
query | SQL Query for InterBase/Firebird Analyze and retrieve your data, build your queries visually, work with query plans, build charts based on retrieved data quickly and more.
datacomparer | Data Comparer for InterBase/Firebird Compare and synchronize the contents of your databases. Automate your data migrations from development to production database.
 | Scroll to top

Oracle

 | SQL Management Studio for Oracle EMS SQL Management Studio for Oracle is a complete solution for database administration and development. SQL Studio unites the must-have tools in one powerful and easy-to-use environment that will make you more productive than ever before!
 | SQL Manager for Oracle Simplify and automate your database development process, design, explore and maintain existing databases, build compound SQL query statements, manage database user rights and manipulate data in different ways.
dataexport | Data Export for Oracle Export your data to any of 20 most popular data formats, including MS Access, MS Excel, MS Word, PDF, HTML and more.
dataimport | Data Import for Oracle Import your data from MS Access, MS Excel and other popular formats to database tables via user-friendly wizard interface.
datapump | Data Pump for Oracle Migrate from most popular databases (MySQL, PostgreSQL, MySQL, DB2, InterBase/Firebird, etc.) to Oracle
datagenerator | Data Generator for Oracle Generate test data for database testing purposes in a simple and direct way. Wide range of data generation parameters.
dbcomparer | DB Comparer for Oracle Compare and synchronize the structure of your databases. Move changes on your development database to production with ease.
extract | DB Extract for Oracle Create database backups in the form of SQL scripts, save your database structure and table data as a whole or partially.
query | SQL Query for Oracle Analyze and retrieve your data, build your queries visually, work with query plans, build charts based on retrieved data quickly and more.
datacomparer | Data Comparer for Oracle Compare and synchronize the contents of your databases. Automate your data migrations from development to production database.
 | Scroll to top

IBM DB2

 | SQL Manager for DB2 Simplify and automate your database development process, design, explore and maintain existing databases, build compound SQL query statements, manage database user rights and manipulate data in different ways.
dataexport | Data Export for DB2 Export your data to any of 20 most popular data formats, including MS Access, MS Excel, MS Word, PDF, HTML and more.
dataimport | Data Import for DB2 Import your data from MS Access, MS Excel and other popular formats to database tables via user-friendly wizard interface.
datapump | Data Pump for DB2 Migrate from most popular databases (MySQL, PostgreSQL, Oracle, MySQL, InterBase/Firebird, etc.) to DB2
datagenerator | Data Generator for DB2 Generate test data for database testing purposes in a simple and direct way. Wide range of data generation parameters.
extract | DB Extract for DB2 Create database backups in the form of SQL scripts, save your database structure and table data as a whole or partially.
query | SQL Query for DB2 Analyze and retrieve your data, build your queries visually, work with query plans, build charts based on retrieved data quickly and more.
 | Scroll to top

Tools & components

advancedexport | Advanced Data Export for RAD Studio VCL Advanced Data Export for RAD Studio VCL allows you to save your data in the most popular office programs formats.
advancedexport | Advanced Data Export .NET Advanced Data Export .NET is a component for Microsoft Visual Studio .NET that will allow you to save your data in the most popular data formats for the future viewing, modification, printing or web publication. You can export data into MS Access, MS Excel, MS Word (RTF), PDF, TXT, DBF, CSV and more! There will be no need to waste your time on tiresome data conversion - Advanced Data Export will do the task quickly and will give the result in the desired format.
advancedimport | Advanced Data Import for RAD Studio VCL Advanced Data Import for RAD Studio VCL will allow you to import your data to the database from files in the most popular data formats.
pdfgenerator | Advanced PDF Generator for RAD Studio Advanced PDF Generator for RAD Studio gives you an opportunity to create PDF documents with your applications written on Delphi or C++ Builder.
querybuilder | Advanced Query Builder for RAD Studio VCL Advanced Query Builder for RAD Studio VCL is a powerful component for Delphi and C++ Builder intended for visual building SQL statements for the SELECT, INSERT, UPDATE and DELETE clauses.
excelreport | Advanced Excel Report for RAD Studio Advanced Excel Report for RAD Studio is a powerful band-oriented generator of template-based reports in MS Excel.
advancedlocalizer | Advanced Localizer for RAD Studio VCL Advanced Localizer for RAD Studio VCL is an indispensable component for Delphi for adding multilingual support to your applications.
 | Scroll to top


Wizard Application

Data Generator for DB2 wizard application provides easy-to-use wizard interface to set all data generation parameters visually.

  • Using wizard application
  • Using configuration files
  • Setting program preferences

Wizard Application - Using wizard application

See also:

Console Application


Using wizard application

Go through the steps of the wizard and follow the wizard instructions to generate test data for your needs.

  • Getting started
  • Step 1 - Setting connection properties
  • Step 2 - Selecting schemas and tables
  • Step 3 - Specifying generation parameters
  • Step 4 - Setting generation options
  • Step 5 - Start of data generation process
  • Step 6 - Editing generation script

See also:

Using console application


Getting started

This is how Data Generator for DB2 wizard application looks when you first start it.

This page allows you to view registration information. If you have not registered Data Generator for DB2 yet, you can do it by pressing the Enter Registration Code... button and specifying your registration information.

Wizard Application - Getting started

When you are done, press the Next button to proceed to Step 1.

See also:

Registration


Step 1 - Setting connection properties

At this step you should enter the necessary settings to establish connection to DB2 server.

Step 1 - Setting connection properties

Please set the database connection properties:

  • provide authorization information: the login and the password for accessing the target DB2 database;
  • type in or use the Database alias drop-down menu to select the database for data generation.

Please note that you should have sufficient privileges to write to the destination database on DB2 server.

When you are done, press the Next button to proceed to the next step.


Step 2 - Selecting schemas and tables

At this step you should select tables for test data generation.

First you should select a schema from the Select Schema drop-down list at the top of the window.

In the Available Tables list you can see all the tables belonging to the selected schema. To select a table, you need to move it from the Available Tables list to the Selected Tables list. In this list tables are displayed with their full names: <schema_name>.<table_name>. To cancel table selection, just remove it from the Selected Tables list. Use the Move all to Selected Move to Selected Move to Available Move all to Available buttons or drag-and-drop operations to move the tables from one list to another.

Hint: To select multiple tables, hold down the Shift or Ctrl key while selecting the table names.

Step 2 - Selecting schemas and tables

Please note that the order of data generation for tables depends on their position in the Selected Tables list. This might be critical in case of generating data for linked tables. You can change their order by dragging tables across the list.

When you press the Next button at this step, Data Generator for DB2 analyzes the order of data generation to avoid referential integrity conflicts and advises you to set a new order for data generation.

When you are done, press the Next button to proceed to the next step.


Step 3 - Specifying generation parameters

At this step you can select columns for generating data and set various data generation parameters.

Selected tables are displayed in the Generate data for tree at the top-left side of the window. Table columns and their types are listed in the grid of the Columns list area below.

Records count

Set the number of data records to be generated for each table.

CheckBox Clear

Set this flag for a table to empty the table before data generation.

Preview

Click the Preview button to browse the selected table data in the preview mode.

Step 3 - Specifying generation parameters

When you select a table in the Generate data for tree, you can set data generation parameters for each of its columns within the Generation properties area at the right side of the window. Use the btnSelectAll btnUnselectAll and the btnInvertSelection buttons to manage columns within the Columns list area. For each column you can set the following:

CheckBox Set NULL value in ... % of cases

Check this option and specify the percentage of NULL values for the column data, if necessary.

Other generation parameters vary according to the data type of the selected column:

  • FLOAT type parameters
  • INTEGER type parameters
  • DATE type parameters
  • TIME type parameters
  • STRING type parameters
  • BLOB type parameters

If a column is part of a foreign key, you can select one of the following options for this column:

RadioButton Generate data from the dependent column

Values for the column will be taken from the corresponding column(s) of the foreign table(s).

RadioButton Generate data from list / SQL-query

RadioButton Ratio 1:N

If this option is selected you should specify the N value using the spin-edit box below. Data will be generated into the column related as 1:N, i.e. n records will be generated into the foreign table for each record of the primary table.

Step 3 - Generation properties - Ratio

When you are done, press the Next button to proceed to the next step of the Wizard.


INTEGER column parameters

Integer data types are used for exact numeric data storage. Values for this column can be generated randomly, incrementally, or they can be taken from a fixed list of values or SQL query, or from an existing table column of the same data type.

The Generation properties panel allows you to define preferences for generating values for integer types.

Integer field parameters

Select Data generation mode as follows:

RadioButton Generate random data

The value is generated randomly within the defined interval (the minimum and the maximum values).

Integer field parameters - Mode - Random data

CheckBox Use formula

This option allows you to correct your data according to a formula; x is a randomly generated value here. Addition, substraction, multiplication, dividing and exponentiation operations (+,-,*,/,^) can be used.

RadioButton Generate incremental data

Specify the Initial value and the Increment properties to generate an ordered incremented sequence of values.

Integer field parameters - Mode - Incremental data

RadioButton Get Data from List / SQL query

This panel allows you to define the list of values to generate integer data from. You can enter these values directly into the editor by selecting the List of Values option.

To add a single value, use the btnListAddValue Add Value button.

To load a list of values from an existing external file, use the btnListLoadFromFile Load from file button.

To save the list to an external file, use the btnListSaveToFile Save to file button.

To remove a single value, use the btnListDeleteValue Delete Value button.

To remove all items from the list, use the btnListClear Clear button.

You can also specify whether the values are to be taken in random order or in the order they have been inputted.

Alternatively, you can set the SQL Query option and input an SQL query into the editor, and the resulting dataset will be used as the list for data generation.

Integer field parameters - Mode - List or query

RadioButton Get data from column

This option allows you to specify a column to generate data from: use the Table and Column drop-down lists to select the source table and column that will be used to take data for generation.

Integer field parameters - Mode - Field


FLOAT column parameters

Float data are used for approximate numeric data storage. Values for this column can be generated randomly, incrementally, or they can be taken from a fixed list of values or SQL query, or from an existing table column of the same data type.

The Generation properties panel allows you to define preferences for generating values for floating point numeric types.

Float field parameters

Select Data generation mode as follows:

RadioButton Generate random data

Here you can define the number of precision and the scale for the result randomly generated values.

Float field parameters - Mode - Random data

RadioButton Generate incremental data

Specify the Initial value and the Increment properties to generate an ordered incremented sequence of values.

Float field parameters - Mode - Incremental data

RadioButton Get data from List / SQL query

This panel allows you to define the list of values to generate floating point numeric data from. You can enter these values directly into the editor by selecting the List of Values option.

To add a single value, use the btnListAddValue Add Value button.

To load a list of values from an existing external file, use the btnListLoadFromFile Load from file button.

To save the list to an external file, use the btnListSaveToFile Save to file button.

To remove a single value, use the btnListDeleteValue Delete Value button.

To remove all items from the list, use the btnListClear Clear button.

You can also specify whether the values are to be taken in random order or in the order they have been inputted.

Alternatively, you can set the SQL Query option and input an SQL query into the editor, and the resulting dataset will be used as the list for data generation.

Float field parameters - Mode - List or query

RadioButton Get data from column

This option allows you to specify a column to generate data from: use the Table and Column drop-down lists to select the source table and column that will be used to take data for generation.

Float field parameters - Mode - Field


DATE column parameters

Date are used for temporal values storage. Values for this type can be generated randomly, incrementally, or they can be taken from a fixed list of values or SQL query, or from an existing table column of the same data type.

The Generation properties panel allows you to define preferences for generating date values for date types.

Date field parameters

Select Data generation mode as follows:

RadioButton Generate random data

Set the date range by defining the minimum and the maximum values.

Date field parameters - Mode - Random data

RadioButton Generate incremental data

Specify the Start and the Increment properties to generate an ordered incremented sequence of dates. The incremented value is day.

Date field parameters - Mode - Incremental data

RadioButton Get data from list / SQL query

This panel allows you to define the list of values to generate temporal data from. You can enter these values directly into the editor by selecting the List of Values option.

To add a single value, use the btnListAddValue Add Value button.

To load a list of values from an existing external file, use the btnListLoadFromFile Load from file button.

To save the list to an external file, use the btnListSaveToFile Save to file button.

To remove a single value, use the btnListDeleteValue Delete Value button.

To remove all items from the list, use the btnListClear Clear button.

You can also specify whether the values are to be taken in random order or in the order they have been inputted.

Alternatively, you can set the SQL Query option and input an SQL query into the editor, and the resulting dataset will be used as the list for data generation.

Date field parameters - Mode - List or query

RadioButton Get data from column

This option allows you to specify a column to generate data from: use the Table and Column drop-down lists to select the source table and column that will be used to take data for generation.

Date field parameters - Mode - Field


TIME column parameters

Time data are used for temporal values storage. Values for this type can be generated randomly, incrementally, or they can be taken from a fixed list of values or SQL query, or from an existing table column of the same data type.

The Generation properties panel allows you to define preferences for generating time values for time types.

Time field parameters

Select Data generation mode as follows:

RadioButton Generate random data

Set the time range by defining the minimum and the maximum values.

Time field parameters - Mode - Random data

RadioButton Generate incremental data

Specify the Start value and the Increment properties to generate an ordered incremented sequence of values.

Time field parameters - Mode - Incremental data

RadioButton Get data from List / SQL query

This panel allows you to define the list of values to generate temporal data from. You can enter these values directly into the editor by selecting the List of Values option.

To add a single value, use the btnListAddValue Add Value button.

To load a list of values from an existing external file, use the btnListLoadFromFile Load from file button.

To save the list to an external file, use the btnListSaveToFile Save to file button.

To remove a single value, use the btnListDeleteValue Delete Value button.

To remove all items from the list, use the btnListClear Clear button.

You can also specify whether the values are to be taken in random order or in the order they have been inputted.

Alternatively, you can set the SQL Query option and input an SQL query into the editor, and the resulting dataset will be used as the list for data generation.

Time field parameters - Mode - List or query

RadioButton Get data from column

This option allows you to specify a column to generate data from: use the Table and Column drop-down lists to select the source table and column that will be used to take data for generation.

Time field parameters - Mode - Field


STRING column parameters

Strings are used for text data storage. The values are sorted and compared on the basis of the collation of the character set assigned to the column. Values for this column can be generated randomly (with constraints or mask used), incrementally, or they can be taken from a fixed list of values or SQL query, or from an existing table column of the same data type.

The Generation properties panel allows you to define preferences for generating string values for string-based types.

String field parameters

Select Data generation mode as follows:

RadioButton Generate random data

String random data can be generated in two ways - by using constraints or by typing the mask.

  • Using constraints

Set the Min length, Max length values to define the minimum and the maximum length for generated values. You can also specify the Start char and the End char segments to be used for string values generation.

String field parameters - Mode - Random data

  • Using mask

Check the option to generate values by mask. Use the Masks window to create and edit various masks for string data generation:

- the 'A' and the 'a' characters are replaced with a random letter (from 'A' to 'Z' and from 'a' to 'z');

- the 'N' character is replaced with a random digit;

- '{n}' results in iteration of the last sign n times;

- the character after the '\' symbol is interpreted as a common character.

All the rest of the mask characters will be moved to the result value without changes.

String field parameters - Mode - Random data - Masks

RadioButton Generate incremental data

Specify the Initial value and the Increment properties to generate an ordered incremented sequence of values.

String field parameters - Mode - Incremental data

RadioButton Get data from list / SQL query

This panel allows you to define the list of values to generate string data from. You can enter these values directly into the editor by selecting the List of Values option.

To add a single value, use the btnListAddValue Add Value button.

To load a list of values from an existing external file, use the btnListLoadFromFile Load from file button.

To save the list to an external file, use the btnListSaveToFile Save to file button.

To remove a single value, use the btnListDeleteValue Delete Value button.

To remove all items from the list, use the btnListClear Clear button.

You can also specify whether the values are to be taken in random order or in the order they have been inputted.

Alternatively, you can set the SQL Query option and input an SQL query into the editor, and the resulting dataset will be used as the list for data generation.

Use of the Sample text option allows you to generate fragments of previously defined text into the string type column. To define sample text used by default, see the Default constraints section of the Preferences dialog.

String field parameters - Mode - List or query

RadioButton Get data from column

This option allows you to specify a column to generate data from: use the Table and Column drop-down lists to select the source table and column that will be used to take data for generation.

String field parameters - Mode - Field


BLOB column parameters

A BLOB is a binary large object that can store a variable amount of data. You can generate values for this column randomly or choose to take them from a specified list of files or SQL query, or from an existing table column of the same data type.

The Generation properties panel allows you to define preferences for generating values for BLOB column type.

BLOB field parameters

Select Data generation mode as follows:

RadioButton Generate random data

Set the Min length, Max length values to define the minimum and the maximum length for generated values.

BLOB field parameters - Mode - Random data

RadioButton Get data from files / SQL query

This panel allows you to define the list of files to generate BLOB data from. You can specify the list of files to use their content as values for the BLOB column by selecting the List of Files option.

To add a file, use the btnListAddValue Add Value button.

To load a list of file paths from an existing external file, use the btnListLoadFromFile Load from file button.

To save the list to an external file, use the btnListSaveToFile Save to file button.

To remove a single file, use the btnListDeleteValue Delete Value button.

To remove all items from the list, use the btnListClear Clear button.

You can also specify whether the files are to be taken in random order or in the order they have been inputted.

Alternatively, you can set the SQL query option and input an SQL query into the editor, and the resulting dataset will be used as the list for data generation.

BLOB field parameters - Mode - Files or query

RadioButton Get data from column

This option allows you to specify a column to generate data from: use the Table and Column drop-down lists to select the source table and column that will be used to take data for generation.

BLOB field parameters - Mode - Field


Viewing table DDL

When you select a schema in the Generate data for tree, you can select a table belonging to the schema and view its DDL structure within the Table Definition area at the right side of the window.

Hint: If more convenient, you can see the DDL of the tables in the hint that popup when the mouse cursor is positioned over the table names within the Generate Data for area.

Step 3 - Viewing table definition

Table Definition

The drop-down list at the top contains the tables that were selected for data generation at Step 2. Select a table to view its DDL.

Right-click within the Table Definition area to call the popup menu allowing you to copy the DDL of the table to Windows clipboard.


Data Preview

The Preview window allows you to browse the selected table data in the preview mode.

Note: The data in preview are selected randomly according to specified parameters and are not actually inserted into the table, i.e. a different set of values will be generated into the table.

To open the window, click the Preview button available at Step 3.

The grid contains all selected columns with data that will be generated according to the parameters you have specified at Step 3. If more convenient, you can change the order of the columns by dragging their headers horizontally.

Click a column caption to sort items by values of this column in the ascending or the descending mode.

Step 3 - Table Preview

If necessary, you can filter records in the grid in either of the following ways:

  • click the Arrow-Down button next to the column caption to display the drop-down list and select any of the column values to filter records by this value of the selected column;
  • click the Arrow-Down button next to the column caption to display the drop-down list, then select the Custom item and build a simple filter using the Custom Filter dialog.

Select a logical operator for checking the column values (like, is less than, is greater than, etc.) and set a value to be checked by this operator in the corresponding box on the right.

Step 3 - Table Preview - Custom Filter

If necessary, you can set the second condition and specify the relation between the two conditions: whether both of them should be satisfied (AND) or just any of them (OR). Use the '_' character to represent any single symbol, and use the '%' character to represent any series of symbols in the condition string.


Step 4 - Setting generation options

At this step you can specify data generation options.

Step 4 - Setting generation options

Action

Specify the action to be taken at the next step of the wizard:

RadioButton Execute statements

Select this option to execute the script for data generation.

RadioButton Save data generation script to file

Select this option if you only need to save the script for data generation to a file, without the script execution.

RadioButton Execute statements and save data generation script to file

Select this option to execute the script for data generation and save it to a file.

File name

This box is enabled if the Save data generation script to file or Execute statements and save data generation script to file option is selected. Type in or use the btnExplorer Explorer button to specify the path to the *.sql file to store the SQL script.

File encoding

Select target encoding for the file.

Line end

Select the required line end symbol for the file: CR LF for Windows OS, LF for Unix or CR for MacOS.

When you are done, press the Next button to proceed to the next step of the Wizard.


Step 5 - Start of data generation process

This step informs you that all data generation parameters are set, and you can start the generation process.

Step 5 - Start of data generation

If everything is correct, press the Generate button to start the process. If you want to change something, you can return to any of the wizard steps using the Back button.

The Generating... dialog indicates the amount of generated records, elapsed time, the number of errors (if any) and visually represents the percentage of data generated.

Step 5 - Generating data

Use the Send to background button to run the process in the background mode, the Minimize button to minimize the application to Windows Task bar, or the Cancel button to stop the generation process.

During data generation the Generation Log area displays the log of performed operations and errors (if any).

When the process is completed, you can use the View SQL file in editor and the Save log to file buttons to edit the data generation script at Step 6 of the wizard and save the generation log content to an external text file respectively.

Do not forget to save data generation options if you need to repeat the generation process with the same (or similar) settings later.


Step 6 - Editing generation script

This step of the wizard allows you to edit the result script for data generation.

For your convenience the code folding, syntax highlight and a number of other features for efficient SQL editing are implemented.

Step 6 - Editing generation script

The context menu of the editor area contains most of the standard text-processing functions (Cut, Copy, Paste, Select All) and functions for working with the script as a whole, e.g. you can move the cursor to a particular line, set markers, toggle bookmarks, etc.

Implementation of the Find Text and the Replace Text dialogs contributes to more efficient work with the SQL code.

Find the complete list of the context menu items below. The context menu allows you to:

  • manage markers: Drop Marker, Collect Marker, Swap Marker;
  • toggle bookmarks allowing you to navigate through the query text and jump to a line with a particular number;
  • go to a line with specified number;
  • perform editing operations: Undo/Redo, Cut, Copy, Paste, Select all;
  • perform search and replace operations;
  • save the script to an external *.sql file;
  • format the selected code using SQL Formatter to make the code easier to read;
  • use the Quick Code features: select a character, toggle a comment for a code fragment, toggle case of the selected text, indent/unindent lines in the script.

Press the Back button to return to any of the previous steps (the content of the editor area will not be lost).

If you press the Save button, the script will be saved to an external file.

Pressing the Close button will result in closing the application (before closing Data Generator will prompt for saving changes).


Using configuration files

Data Generator for DB2 allows you to store its settings in external *.gtm files if you need to repeat data generation process several times.

You can load previously saved configuration settings to the application wizard if you need to make some changes before data generation, or you can run it with the console application for quicker generation.

  • Saving configuration file
  • Loading configuration file

See also:

Using wizard application

Setting program preferences


Saving configuration file

Data Generator templates are saved within the Save template options dialog. To open this dialog, press the Tools button and select the Save Template popup menu item.

Please note that you can save data generation options at the steps from Specifying generation parameters to the last step of Data Generator for DB2 wizard.

  • Save Template options
  • Loading configuration file


Save Template options

File name

Specify the template file name and select its location using the btnSaveAs button to open the Save As... dialog.

Comment

If necessary, set a comment for your template file in this field.

Using configuration files - Save Template options


Loading configuration file

Data Generator templates are loaded within the Open template dialog. To open this dialog, press the Tools button and select the Load template popup menu item.

Please note that you can reopen a template at the steps from starting to Specifying generation parameters of the wizard using the corresponding popup menu item of the Tools menu.

  • Saving configuration file
  • Save Template options


Setting program preferences

Data Generator for DB2 provides full customization of the program interface by setting various options within the Preferences dialog. This chapter is intended to inform you how to use these options.

General

These options define general behavior of Data Generator for DB2

Defaults

This page allows you to set the constraints for data values used by default in the generation process.

Language

This page allows you to select a language to be applied for your copy of Data Generator for DB2.

See also:

Using wizard application

Using configuration files


Setting general options

This page allows you to define general options of the application.

Theme

Select the main color theme for the application: Light or Dark.

Number of records to generate

Sets the quantity of records generated by default.

Commit every ... records

Specifies the number of records in each block of the generation script to be supplemented with the COMMIT statement.

Number of records to preview

Sets the quantity of records used in the Data Preview window by default.

CheckBox Set NULL value in ... % of cases

This option allows you to specify the percentage of records that will remain NULL by default.

Preferences - General

CheckBox Confirmation on exit

Enables/disables confirmation upon exiting the program.

CheckBox All columns selected by default

Check this option to include all columns into the data generation process by default.

CheckBox BLOB columns selected by default

Uncheck this option if you need to exclude BLOB columns from the generation process by default.

CheckBox Clear tables before generation

Set this option to empty tables before data generation.

CheckBox Save passwords

Setting this option allows you to save passwords used for access to the databases automatically upon closing the application. Please note that checking this option saves the latest password used for connection to the database.

See also:

Setting default constraints

Setting program language


Setting default constraints

In this section you can define default constraints for all supported data types:

Numeric types

Character types

Date/Time types

Default values are used as initially set values for data range and can be modified at Step 3.

See also:

Setting general options

Setting program language


Numeric types

On this tab you can define default constraints for numeric types.

Preferences - Defaults - Numeric

Integers types

Set the target minimum and maximum values set by default for integer types.

Floating-point types

Set the precision and scale values set by default for floating-point types.


Character types

On this tab you can define default constraints for character types.

Min Length

Set the minimum length of the generated value.

Max Length

Set the maximum length of the generated value.

Start Char

Select the start char for the range to be used for generation.

End Char

Select the end char for the range to be used for generation.

CheckBox Include new line

Select this option to allow line feeds in generated string values.

CheckBox Windows new line

Select this option to specify Windows-style line feeds.

Preferences - Defaults - Character

Sample Text

If more convenient, you can input any string that will be used as sample text. You can choose to generate sample text when setting generation parameters for strings.


Date/Time types

On this tab you can define default constraints for date and time types.

Preferences - Defaults - DateTime

Min Date

Select the start date for generating date values.

Max Date

Select the end date for generating date values.

Date format

Type in or use the drop-down list to specify the preferable date format.

Min Time

Select the start range time for generating time values.

Max Time

Select the end range time for generating time values.

Time format

Type in or use the drop-down list to specify the preferable time format.


Setting program language

The Language page is provided for managing Data Generator localization files.

You can create your own *.lng files similar to those available in the %program_directory%\Languages folder, add them to the list of available languages and set the new language as the program interface language.

Available languages

Lists all the languages available for localization and the corresponding *.lng files. Double-click a language in the list to edit its name or the *.lng file.

Preferences - Localization

Language directory

Use the btnExplorer button to specify the directory where the *.lng files are stored by default.

See also:

Setting general options

Setting default constraints


Trees and lists

Use the Trees and lists section to view and edit the corresponding options.

Preferences - Interface - Trees and lists

Look & feel

This setting determines the manner in which tree and list elements are painted. Use the drop-down list to select the painting style that will be applied to the trees and lists:

Standard

Flat

UltraFlat

CheckBox Hide selection

This option specifies how selected tree nodes and list items are displayed when focus leaves the tree or list control.

If this option is enabled, selected nodes look like other nodes. Otherwise, selected nodes/items are highlighted within the tree/list.

CheckBox Hide focus rectangle

This option determines whether a focus rectangle is displayed around the focused tree node or list item within the tree or list control.

If this option is disabled, the focused node/item is not highlighted but the focus rectangle is displayed around it.

CheckBox Native style

This option determines whether the native Windows style will be applied to the trees and lists.

The option has the highest priority for trees and lists. If this option is selected, the tree nodes and list items are painted according to the native Windows style, regardless of other painting settings.

Note: The Native style option is currently supported for the Windows® XP operating system only.

See also:

Edit controls

Check boxes

Buttons

Page controls

Group boxes

Fonts


Edit controls

Use the Edit controls section to customize the appearance of various Data Generator for DB2 edit controls: Border style, Button style, Button transparency, etc.

Preferences - Interface - Edit controls

Border style / Button style

Use these drop-down lists to specify the style around an editor (the edit control borders) and select the painting style that will be applied to the edit control buttons (ellipsis button, arrow-down combo-box button, etc.) respectively:

None

Single

Thick

Flat

3D

UltraFlat

Button transparency

Represents the button transparency mode within an editor. Use the drop-down list to specify the transparency that will be applied to the edit control buttons (ellipsis button, arrow-down combo-box button, etc.):

None (a button is always displayed in a non-transparent fashion)

Inactive (a button is drawn when the editor has focus or when the mouse cursor is positioned over the button; otherwise, the button is transparent)

Always (a button is always transparent)

Hide inactive (a button is drawn only when the editor has focus; otherwise, the button is invisible)

Hide unselected (a button is drawn when the editor has focus or when the mouse cursor is positioned over the editor region; otherwise, the button is invisible).

Edges

This group defines which edges are displayed within an editor. Check/uncheck the boxes to hide/show individual edges of the edit controls:

CheckBox Left (if unchecked, the left border edge is invisible)

CheckBox Right (if unchecked, the right border edge is invisible)

CheckBox Top (if unchecked, the top border edge is invisible)

CheckBox Bottom (if unchecked, the bottom border edge is invisible)

CheckBox Hot track

This option specifies whether editor items are highlighted when the mouse cursor is positioned over an edit control. Select this option to highlight an edit control in response to mouse movements.

CheckBox Shadow

If this option is selected, a shadow is displayed for the edit controls.

CheckBox Native style

This option determines whether the native Windows style will be applied to the edit controls.

The option has the highest priority for edit controls. If this option is selected, the edit controls are painted according to the native Windows style, regardless of other painting settings.

Note: The Native style option is currently supported for the Windows® XP operating system only.

See also:

Trees and lists

Check boxes

Buttons

Page controls

Group boxes

Fonts


Check boxes

Use the Check boxes section to customize the border style and the appearance of check boxes and radio buttons.

Preferences - Interface - Check boxes

Border style

This setting determines the manner in which check box and radio group borders are painted. Use the drop-down list to select the painting style that will be applied to the check boxes and radio groups:

None

Single

Thick

Flat

3D

UltraFlat

CheckBox Hot track

This option specifies whether check boxes are highlighted when the mouse cursor is positioned over the check box controls. Select this option to highlight check boxes in response to mouse movements.

CheckBox Shadow

If this option is selected, a shadow is displayed for the check boxes and radio groups.

CheckBox Native style

This option determines whether the native Windows style will be applied to the check boxes and radio buttons.

The option has the highest priority for check boxes and radio buttons. If this option is selected, the check boxes and radio buttons are painted according to the native Windows style, regardless of other painting settings.

Note: The Native style option is currently supported for the Windows® XP operating system only.

See also:

Trees and lists

Edit controls

Buttons

Page controls

Group boxes

Fonts


Buttons

Use the Buttons section to customize Data Generator buttons.

Preferences - Interface - Buttons

Button kind

This setting determines the manner in which a button is painted. Use the drop-down list to select the painting style that will be applied to buttons:

Standard

Flat

UltraFlat

CheckBox Native style

This option determines whether the native Windows style will be applied to the buttons.

The option has a higher priority than the Button kind setting. If this option is selected, the buttons are painted according to the native Windows style, otherwise the Button kind selection is applied.

Note: The Native style option is currently supported for the Windows® XP operating system only.

See also:

Trees and lists

Edit controls

Check boxes

Page controls

Group boxes

Fonts


Page controls

Use the Page controls section of the Preferences dialog to customize the style of all Data Generator page controls.

Preferences - Interface - Page controls

Tabs are visual elements of tab controls. Their purpose is to identify pages and switch between them. Once a tab is clicked, the corresponding page is selected.

Pages are container controls that represent the contents of tab controls. Tab controls contain a single page, whose context is to be updated each time the selected tab changes. Page controls contain the number of pages equal to the number of tabs.

Tab style

Use the drop-down list to select the painting style that will be applied to the tab controls:

Tabs (tabs are painted as notebook tabs)

Buttons (the selected tab is painted as a pressed button, other tabs are painted as released buttons)

Flat (tabs are painted as notebook tabs, but appear lowered slightly)

CheckBox Hot track

This option specifies whether tab captions are highlighted when the mouse pointer hovers over tabs. Select this option to enable tab highlighting.

CheckBox Multiline pages

This option specifies whether tabs are arranged across several rows.

If this option is enabled, tabs are automatically arranged into the minimum number of rows required to fit all of them. If this option is disabled, tabs are displayed within a single row.

CheckBox Native style

This option determines whether the native Windows style will be applied to the tab controls.

The option has the highest priority for the tab controls. If this option is selected, the tabs are painted according to the native Windows style, regardless of other painting settings.

Note: The Native style option is currently supported for the Windows® XP operating system only.

See also:

Trees and lists

Edit controls

Check boxes

Buttons

Group boxes

Fonts


Group boxes

Use the Group boxes section to customize all Data Generator group boxes to your liking.

Preferences - Interface - Group boxes

Border style

This setting determines the manner in which group box borders are painted. Use the drop-down list to select the painting style that will be applied to the group boxes:

None

Single

Thick

Flat

3D

UltraFlat

CheckBox Shadow

If this option is selected, a shadow is displayed for the group boxes.

CheckBox Native style

This option determines whether the native Windows style will be applied to the group boxes.

The option has the highest priority for the group boxes. If this option is selected, the group boxes are painted according to the native Windows style, regardless of other painting settings.

Note: The Native style option is currently supported for the Windows® XP operating system only.

See also:

Trees and lists

Edit controls

Check boxes

Buttons

Page controls

Fonts


Fonts

This section of the Preferences dialog allows you to specify fonts used in the application.

The box below displays the sample text with the selected font applied.

Preferences - Interface - Fonts

System font name
Defines the font used by Data Generator for DB2. Select the font name from the drop-down list of available system fonts.

Preferences - Interface - Fonts - System font name

System font size

Defines the font size used by Data Generator for DB2. Type in or use the drop-down list to select the required value.

See also:

Trees and lists

Edit controls

Check boxes

Buttons

Page controls

Group boxes


Console Application

Additionally to the GUI version which is implemented in the form of a wizard application, the installation package of Data Generator for DB2 includes the console version which is intended for being run from Windows command line with a template file name used as the execution parameter.

Data Generator for DB2 command line utility is intended for quick and powerful data generation to DB2 tables.

  • Using console application

See also:

Wizard Application


Using console application

All the generation options are set in template (*.gtm) files. A template can be also used in the Console version of Data Generator for DB2 .

To create a template file, follow the instructions below:

  • start Data Generator for DB2 Wizard Application;
  • set all the required options in all steps of the wizard;
  • test the generation process at the last step;
  • save all generation options in the template file.

The easiest way to start Data Generator for DB2 console application is to double-click the generated *.gtm template file. The other way is to enter the command line and type the appropriate command.

Usage:

<path to Data Generator for DB2 console application>\Db2DataGenC.exe TemplateFile [-L] [-B]

TemplateFile

Stands for the *.gtm template file to be used as the console version execution parameter

[-L]

Applies the current localization selected in Wizard Application (GUI)

[-B]

Use this parameter in the command line to run the console version of Data Generator for DB2 in background mode

Example:

"C:\Program Files\EMS\Data Generator for DB2\Db2DataGenC.exe" "C:\EMS\Templates\DataGenerator\Example.gtm" -L

Note: The following exit codes can be returned by Data Generator for DB2 to the operating system after performing the latest task:

0 - successful completion;

1 - error(s) occurred during task performing;

2 - fatal error occurred. The task was not performed.

See also:

Using wizard application

Configuration file format


Data generation mode

This option defines data generation mode - random data generation, incremented values generation or getting data from list or SQL query, or getting data from an existing table column.

Select the Generate random data option to generate random data within the defined range.

Another mode - Generate incremental data - allows one to set the initial value and the increment for generated values.

Select the Get Data from List / SQL query option to generate data by getting values from the user-defined list randomly or in the fixed order. This can be:

- a list of values (for numeric, string, date/time, boolean data types);

- a list of files (for BLOB data type);

- an SQL query;

- previously defined sample text (for string data types).

Select the Get data from column option to specify a column to generate data from: use the Table and Column drop-down lists to select the source table and column that will be used to take data for generation.


Configuration file format

The configuration (template) file used by Data Generator for DB2 is divided into several sections, each corresponding to a particular group of settings specified at different steps of the GUI application wizard.

[#General#]

This section stores general information about the utility:

Parameter | Description
Product | internal product name
Version | major version

[#Comment#]

This section stores the template file comment as specified optionally in the Save template options dialog:

Parameter | Description
Line<N> | comment text

where N stands for the comment line identifier

Example:

Line0=Data Generator for DB2

Line1=Template file

Line2=Data generation #1

[CONNECTION]

This section stores connection parameters to DB2. The parameters correspond to the values entered at Step 1 of the Wizard application and are obligatory.

Parameter | Description
DBAlias | DB2 database alias
Login | DB2 login (if NTAuth = 0)
Password | password to identify DB2 login (encrypted)
Major | major version used to encrypt the passwords (the value must not be changed)
Minor | minor version used to encrypt the passwords (the value must not be changed)
PassPhrase | the parameter is not used by Data Generator for DB2

[ADDITIONAL]

The section contains additional settings specified at Step 2 and Step 4 of the Wizard application.

Parameter | Description
TablesCount | number of tables selected for data generation
SqlExecute | corresponds to the Execute statements option of the Action radio group available at Step 4: 1 = enabled 0 = disabled
SqlSave | corresponds to the Save data generation script to file option of the Action radio group available at Step 4: 1 = enabled 0 = disabled
SaveFile | path to the script file (if SqlSave = 1)
BlobFile | the parameter is not used by Data Generator for DB2
ExportBlobType | the parameter is not used by Data Generator for DB2

[TABLE_XX]

The section is repeated for all tables; the settings are specified at Step 3 of the Wizard application.

Parameter | Description
Schema | indicates the name of the schema where the table is located
TableName | indicates the name of the table to generate data into
RecordCount | number of records to be generated
ClearBeforeGeneration | 1 leads to emptying table 0 leaves the table as it was before data generation

[TABLE_XX_FIELD_YY]

The section is created for each field of each table.

Parameter | Description
DoGenerate | 0 indicates that the field is excluded 1 indicates that the field is included
IncludeNulls | 1 specifies that the NULL values are set for certain percent of cases 0 disables this option
NumNulls | the percentage of field values to be set to NULL
GenMethod | defines Data generation mode: 0 stands for incremental data generation 1 = random data generation 2 refers to Get data from list / SQL query option 3 = from another field
GenFromSQL | 0 = the direct list of values is taken for data generation 1 = SQL query is used
SQL | text of the SQL query from which a list of values is taken for generation (as the result of the SQL query execution)
UsingMask | 0 = no mask is used for string field values 1 = generation of string field values by mask
Mask | mask for string field values generation
MinInt | minimal value for integer fields
MaxInt | maximal value for integer fields
UseFormula | 0 = no formula 1 = a formula is applied for data generation
Formula | formula for data generation, e.g. x*2+1
Digits | digits quantity for float fields
Precision | precision value for float fields
MinDate | minimum value for date fields
MaxDate | maximum value for date fields
IncludeTime | indicates whether time is added (for DATETIME fields)
MinTime | minimum value for time fields
MaxTime | maximum value for time fields
MinLength | minimum length for string fields
MaxLength | maximum length for string fields
StartChar | first char code for generating strings
EndChar | last char code for generating strings
Charset | field character set
InitialValue | the initial value for data generation into the field
IncrementStep | specifies the step to increment values (for GenMethod = 0)
UseNewLine | 1 = a line feed is used for a new line 0 = no line feeds used
WinNewLineStyle | style to be applied to line feeds: 1 = Windows style 0 = Unix style
SampleText | sample text to be generated for a string field


Find Text dialog

The Find Text dialog is provided for quick and flexible searching for specified text within the working area of the script editor.

Text to find
Enter a search string in this box. The Arrow-Down button which can be found next to the input box allows you to select any of the previously entered search strings.

Options
CheckBox Case sensitive
This option can be used to differentiate uppercase characters from lowercase ones during the search process.

CheckBox Whole words only
Use this option to search for words only (with this option off, the search string might be found within longer words.)

CheckBox Regular expressions
Recognizes regular expressions in the search string.

Direction
RadioButton Forward
Searches from the current position to the end of the working area.

RadioButton Backward
Searches from the current position to the beginning of the working area.

Scope
RadioButton Global
Searches within the entire working area, in the direction specified by the Direction setting.

RadioButton Selected text
Searches only within the currently selected text, in the direction specified by the Direction setting. You can use the mouse or block commands to select a block of text.

Origin
RadioButton From cursor
The search starts at the cursor's current position, and then proceeds either forward to the end of the scope, or backward to the beginning of the scope depending on the Direction setting.

RadioButton Entire scope
The search covers either the entire block of selected text or the entire script (no matter where the cursor is in the Editor area) depending upon the Scope options.

CheckBox Mark search result with stack marker
The option toggles marking search results. If this option is selected, stack markers are set at all search positions - this makes it possible to jump from one marker (search result) to another within the text.

Click the Show All button to highlight every occurrence of the search string.


Replace Text dialog

The Replace Text dialog is provided for searching and replacing text within the working area of the script editor.

Text to find
Enter a search string in this box. The Arrow-Down button which can be found next to the input box allows you to select any of the previously entered search strings.

Text to replace
This box allows you to enter a string to replace the search string. The Arrow-Down button which can be found next to the input box allows you to select any of the previously entered strings. To replace the search string with an empty string, leave this input box blank.

Options

CheckBox Case sensitive
This option can be used to differentiate uppercase characters from lowercase ones during the search process.

CheckBox Whole words only
Use this option to search for words only (with this option off, the search string might be found within longer words.)

CheckBox Regular expressions
Recognizes regular expressions in the search string.

CheckBox Replace with template

This option requires the Regular expressions option selection.

Enable this option to use regular expressions in the Text to replace field. Expression used in this field will be applied to each string that matches the Text to find expression.

Note: The syntax of regular expressions that can be used in the Text to find and the Text to replace fields is similar to that used in Perl regular expressions. Comprehensive information about it can be found at http://perldoc.perl.org/perlre.html#Regular-Expressions.

CheckBox Prompt on replace
Check this option if you wish to be prompted before replacing upon each occurrence of the search string. When this option is off, the search string is replaced automatically.

Direction

RadioButton Forward
Searches and replaces from the current position to the end of the working area.

RadioButton Backward
Searches and replaces from the current position to the beginning of the working area.

Scope

RadioButton Global
Searches and replaces within the entire working area, in the direction specified by the Direction setting.

RadioButton Selected text
Searches and replaces only within the currently selected text, in the direction specified by the Direction setting. You can use the mouse or block commands to select a block of text.

Origin

RadioButton From cursor
The search and replace process starts at the cursor's current position, and then proceeds either forward to the end of the scope, or backward to the beginning of the scope depending on the Direction setting.

RadioButton Entire scope
The search and replace process covers either the entire block of selected text or the entire script (no matter where the cursor is in the Editor area) depending upon the Scope options.

CheckBox Mark search result with stack marker
The option toggles marking search results. If this option is selected, stack markers are set at all search positions - this makes it possible to jump from one marker (search result) to another within the text.

Click the Replace All button to replace every occurrence of the search string. If you have checked the Prompt on replace option, the confirmation dialog box appears upon each occurrence of the search string.


Advanced connection settings

You need the installed Oracle client on the client computer where Data Generator for DB2 will be used. The version of the Oracle client should be compatible with the version of Oracle server you need to connect.

You need to add the connection settings of Oracle server databases to your TNS names file (tnsnames.ora file). This is a configuration file which contains databases description.

If you use Database Client the tnsnames.ora file is located in the %HOME_name\NETWORK\ADMIN directory.

If you use Instant Client for oracle, you should create tnsnames.ora file manually. since it does not exist. File should be created in the same directory where Oracle instant client is installed (e.g. C:\OracleInstantClient\). This file can be created using any text editor (create a simple text file and then change its name and extension).

Only for Instant Client: After the tnsnames.ora file is created and database description is added, create TNS_ADMIN environment variable. For this please do the following:

  1. Right-click 'My computer'.
  2. Select 'Properties' menu item.
  3. Proceed to the 'Advanced' tab and press 'Environment Variables' button.
  4. Press 'New...' button in the 'System variables' section.
  5. Set 'Variable name:' TNS_ADMIN, 'Variable value:' C:\OracleInstantClien\tnsnames.ora
  6. Press 'OK' button to save the variable.

Find PATH variable in the same dialog, double-click it and add path to the Oracle Instant client libraries (they are located in the directory where client is installed, i.e. C:\OracleInstantClient\). Remember that the paths entries should be separated with semicolons ( ; ).

Data Generator for DB2 connects to the server (with the help of Oracle client) via TCP/IP protocol. Here is an example of TCP/IP connection specified in TNS names file:

DB_Alias =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = Host_name)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = Database_Name)

)

)

PROTOCOL is the keyword that identifies the specific protocol adapter used. For this protocol, the value is TCP. The value can be entered in either uppercase or lowercase.

HOST is the host name or IP address.

PORT is the TCP/IP port number.

SERVICE_NAME the name of service on server; the database instance name may differ from the actual database name, but generally the names match.

DB_Alias any name of the connection

At the firs step select Oracle client HOME in Database home dropdown list and select database from the Database dropdown list. The databases names are taken from the tnsnames.ora file.