Populating the test tables with data
To populate test tables, use SQL INSERT statements or the LOAD utility.
About this task
You can put test data into a table in several ways:
- INSERT ... VALUES (an SQL statement) puts one row into a table each time the statement executes.
- INSERT ... SELECT (an SQL statement) obtains data from an existing table (based on a SELECT clause) and puts it into the table that is identified in the INSERT statement.
- MERGE (an SQL statement) puts new data into a table and updates existing data.
- The LOAD utility obtains data from a sequential file (a non-Db2 file), formats it for a table, and puts it into a table.
- The Db2 sample UNLOAD program (DSNTIAUL) can unload data from a table or view and build control statements for the LOAD utility.
- The UNLOAD utility can unload data from a table and build control statements for the LOAD utility.
Redirected recovery, the RECOVER utility with the FROM option, can recover data from a production table to a test table with no impact to the availability of the production data and applications. The production data can be recovered to the test object to a point in time or to the current state with transactional consistency. SQL or the UNLOAD utility can then be used on the data in the test table.