DB2 10.5 for Linux, UNIX, and Windows

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 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 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.