SQL scripts  Creating CSP tables

Chapter 7: Creating Database Tables

Creating PUBS tables

PUBS is a sample database that contains tables that you can use to test the transfer process between DB2 and SQL Server. Use the pubsdb2.sql script to create the tables by performing the following steps:

StepsTo create PUBS tables

  1. Start the DirectConnect server.

  2. If you are using Windows, display the Windows command line.

  3. Edit pubsdb2.sql to create the tables in the desired DB2 database and tablespace.

    For example, you can modify the script to say one of the following:

    NoteThe user ID must have CREATE TABLE privileges in the specified databasename.tablespacename.

  4. Run pubsdb2.sql:

    isql -Uuserid -Ppassword -Sservice_name -ipubsdb2.sql
    

    where:

    The script drops any tables with the same names as the tables it creates. If the table does not exist, the DropTable command returns an error message. This does not prevent successful execution of the rest of the script. The script creates indexes for the remaining tables.

  5. To verify that you successfully created the PUBS database in DB2, log in to DirectConnect: isql -Uuserid -Ppassword -Sservice_name

  6. Issue the following select statement against PUBS:

    select * from authors
    

    If you successfully created the PUBS database, DB2 returns data from the authors table.

    If you receive an error, run the pubsdb2.sql script again or review the log files.

For information about the transfer function, see the DirectConnect for z/OS Access Service User’s Guide.





Copyright © 2005. Sybase Inc. All rights reserved. Creating CSP tables

View this book as PDF