Creating the SAMPLE database on Host or System i servers

If you want to run the sample programs against a Host server such as Db2 for z/OS or Db2 for IBM i, you need to create a database that contains the sample tables described in the SQL Reference.

Before you begin

You need Db2 Connect to connect to a host server.

About this task

There are some SQL syntax and Db2® command differences between Db2 on the workstation and Db2 on host systems. When accessing databases on Db2 for z/OS or Db2 for IBM i, make sure your programs use SQL statements and precompile or bind options that are supported on these database systems.

Procedure

To create the database:

  1. Create the SAMPLE database in a Db2 workstation server instance by using db2sampl.
  2. Connect to the SAMPLE database.
  3. Export the sample table data to a file.
  4. Connect to the host database.
  5. Create the sample tables.
  6. Import the sample table data from the file where you exported the data on the workstation server.