Copying data from one Db2® object to another

To copy data between Db2® tables, use the Copy utility function (3.3).
Note:
  1. To copy data to a Db2® table or view from a QSAM or VSAM data set, use the Import utility function (3.6).
  2. To copy data from a Db2® table or view to a QSAM or VSAM data set, use the Export utility function 3.7).
When you copy data from one Db2® object to another, you can:
  • Select which rows to copy
  • Reformat data during the copy by mapping columns in the input table to different columns in the output table
  • Initialize new columns using user-specified values or patterns
  • Limit the number of rows copied

The main panel for the Copy utility is the Copy Utility ("From") panel.

To display the Copy Utility ("From") panel,

  1. From the Primary Option Menu panel, enter 3 (Utilities) to display the Utility Functions panel.
  2. From the Utility Functions panel, enter 3 (Copy)
You can now specify details about:
  • The source table (where the data is that you want to copy). During this step, you can also edit the source template to restrict the data that is copied (if applicable).
  • The target table (where you want the data copied). During this step, you can also change the copy options, edit the template mapping for the target table, and specify if you want the copy performed in a batch job.

Related tasks

Related references