You are here: Available Utilities > D > DB2DB > DB2DB Example 1

DB2DB Example 1

How to convert an XDB dictionary (a CB5 table) into a DB2 table:

db2dbw32 /st=xdb /sb=.\deflib\xdb.dfd /sh=CB5 /tt= xdb2 /td= .\deflib\xdb.dfd /th=db2

These parameters tell the utility to copy the source table (XDB), which is associated with the xBase DBHandler called CB5 and is mapped using the XDB.DFD file in the .\deflib directory, to the target table (xdb2), which is associated with a DB2 DBHandler called DB2 and is also mapped using the same DFD file. In this example, the actual name of the XDB2 DB2 table is CP_Xpress.

In this example, your FSIUSER.INI file contains entries similar to these. The DB2 table, cpxdb2, is contained in the DB2 database, CP_Xpress.

< DBHandler:DB2 >
  Database	= CP_Xpress
  BindFile	= c:\dap32103\dll\db2lib.bnd
  Connect	= Yes
  CreateTable	= Yes
  UserID	= db2admin
  Debug		= Yes
  PassWd	= XXX
< DBTable:xdb >
  DBHandler	= CB5
< DBTable:xdb2 
  DBHandler	= DB2
< DB2_FileConvert >
  xdb2		= cp_xpress_xdb

You can use the DB2_FileConvert INI control group to specify longer names for the table in DB2.

Option

Description

CreateTable

Enter Yes so DB2 will create the table if it does not exist.

BindFile

Enter the name and path of the DB2LIB.BND file.

See also DB2DB Example 2.