Populating a Db2® table with data

You can populate a table with data by using the FM/Db2 Create utility (3.8). You can specify the number of rows that are to be created and how each row is to be initialized. By editing a template, you can use fill characters and patterns to initialize the data and change the data create attributes for individual columns.

When fill characters and/or patterns are used to initialize a column, the resultant data must conform to any data type restrictions imposed by Db2® for that column.

During the data creation process, FM/Db2 attempts to insert each row formatted by the data create utility into the target Db2® object. The insert operation may be rejected by Db2® if uniqueness, referential integrity, or other constraints would be violated.

The data create operation can be performed in background (batch execution) or in the foreground.

The main panel for the FM/Db2 Create utility is the Data Create Utility panel.

To display the Data Create Utility panel,

  1. From the Primary Option Menu panel, enter 3 (Utilities) to display the Utility Functions panel.
  2. From the Utility Functions panel, enter 8 (Create)

Now that you have the Data Create Utility panel displayed, you can specify the name of the table you want to populate with data, the number of rows that are to be created, and how each row is to be initialized:

  1. Identify the Db2® table you want to populate with data using the Specify the Db2® Object entry fields.
  2. Use the Create Count entry field to specify the number of rows you want to create.
  3. If you are using a specific template to specify the data initialization details, (see option 1 in Template usage), specify the name of the template data set.
  4. Use the Processing Options to specify which template you want to use for the create process, and whether you want to edit the template before the create process.
  5. Press Enter. If you selected Edit template, the Column Selection/Edit panel is displayed. Otherwise, FM/Db2 creates the data in the specified Db2® table.

Related tasks

Related references