WebSphere logo Classic Federation Server for z/OS, Version 9.1
WebSphere logo Classic Replication Server for z/OS, Version 9.1
WebSphere logo Classic Data Event Publisher for z/OS, Version 9.1
WebSphere logo Data Integration Classic Connector for z/OS, Version 9.1


Creating tables and views for DB2 for z/OS databases

To query or update data in a DB2® for z/OS® source, you must create a relational table that maps to that data source. You open a connection to a DB2 for z/OS subsystem and import the table or view into a physical data model. Then, you can generate and run the DDL.

Before you begin

In your data design project, you must have at least one physical model.

About this task

You can import DB2 tables, views, materialized query tables, and aliases. All of these objects become tables in a schema in a physical data model.

Dropping a DB2 object into a schema adds the object to that schema. Dropping a DB2 object into a data design project that has no schema causes Classic Data Architect to create a schema and add the DB2 object to it. Dropping an entire DB2 schema into a data design project adds that schema to the project and imports all of the DB2 objects that are in the DB2 schema.

When objects are created, they are created with DB2 column and, if applicable, indexes.

Columns that are not supported in Classic federation are not added.

Procedure

To create tables or views for DB2 for z/OS databases:

  1. Create a connection to the DB2 for z/OS subsystem. Follow these steps:
    1. In the Database Explorer, right-click the Connections folder and select New Connection.
    2. In the New Connection wizard, under Select a database manager, expand DB2 zSeries and select the appropriate version.
    3. Provide the connection information and click Finish.
  2. In the Database Explorer, expand these objects:
    1. the database
    2. the Schemas folder
    3. the schema of the table or view that you want to import
    4. the Tables folder or the Views folder for the schema
  3. Drag a DB2 object into the Data Project Explorer.

    Dropping a DB2 object into a schema adds the object to that schema. Dropping a DB2 object into a data design project that has no schema causes Classic Data Architect to create a schema and add the DB2 object to it. Dropping an entire DB2 schema into a data design project adds that schema to the project and imports all of the DB2 objects that are in the DB2 schema.

  4. In the Available Actions window, ensure that Drop DB2 objects into a Classic model is selected and click OK.
  5. In the Specify DB2 Plan window, specify the name of the plan that contains the packages for the SQL statements that client applications will make against the DB2 objects. After you click OK, the DB2 objects appear in the your data design project.
  6. Optional: Modify the table properties or add privileges. Select the table and make any changes in the Properties view.
  7. Optional: Open the Generate DDL wizard and generate the CREATE statement for the table. With this wizard, you can generate the SQL DDL to define the tables and views and choose to run the DDL on a data server so that the tables and views are created in the metadata catalog for that data server. You can also edit the generated DDL before you run it.

    After you run the DDL, the tables appear on the data server in the Database Explorer. To see the tables, expand the data server and navigate to Schemas > table schema name > Tables.

    The views appear on the data server under Schemas > view schema name > Views.

    If you want to generate and run the DDL for more than one object at a time, you can right-click a schema and select Generate DDL. The Generate DDL wizard will generate the DDL for all of the objects in the schema.

  8. Optional: If you created the tables and views on the data server, run a test query on the tables.
    1. In the Database Explorer, right-click a table or view and select Data > Sample Contents.
    2. Look in the Data Output view to see the results of the test query.
Related concepts
Mapping data for Classic federation
Viewing and modifying objects
Populating metadata catalogs
Related tasks
Creating Adabas tables and views for Classic federation
Creating CA-Datacom tables and views for Classic federation
Creating CA-IDMS tables and views for Classic federation
Creating CICS VSAM tables and views for Classic federation
Creating IMS tables and views for Classic federation
Creating sequential tables and views for Classic federation
Creating VSAM tables and views for Classic federation
Creating indexes
Creating stored procedures
Modifying the PCB selection for IMS tables or indexes


Feedback

Update icon Last updated: 2007-07-11