This document covers the following topics:
For DB2 tables and views, a Predict object documenting the DB2 database containing the tables/views must exist.
For SQL/DS tables and views, a corresponding database object in Predict is not required. See the section DB2 and SQL/DS in the Predict and Other Systems documentation.
See Concepts of Incorporation for basic information on how to use incorporation functions.
The Incorporate DB2 Tables/Views
screen is called with function code I and object code T2 in a Predict main menu
or with the command
17:55:19 ***** P R E D I C T ***** 2007-05-31 Plan 0 - Incorporate DB2 Tables/Views - Table / View name ..... SQL Server ...........* <Default Server> Select options Tables or Views ....* Creator name ........ DB2 database name ... Processing option Connect automatic ... N (Y,N) Update when connecting File attributes ..... Y (Y/N) Command ===> Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Next Stop Last LnkEl Flip Print Impl AdmFi SelFi Prof Main
Common parameters which are not included in the table below are described under Common Parameters for All DB2 Types.
|Table / view name||The name in DB2 of the tables and views from which the data dictionary objects are to be created. Asterisk notation is allowed.|
|Tables or views||
|Creator name||The DB2 "creator" of the tables and views from which the data dictionary objects are to be created. Asterisk notation is allowed.|
|DB2 database name||The name in DB2 of the database or databases in which the specified tables and views reside. Asterisk notation is allowed. When incorporating Tables/Views from SQL/DS, this parameter is protected.|
|Connect automatic||Y - DB2 table/views and the Predict object will be connected by the Compare function (code T) if no differences were detected between the field lists of the two objects.|
|File attributes||Y - Attributes of the Predict file object and, for files of type E, the subselect specification of the SQL create statement are to be updated. The triggers linked to the file via association "Has TR" are also updated.|
Files which meet the given selection criteria and are not already connected to a Predict file object are then listed as follows.
13:03:38 ***** P R E D I C T ***** 2007-05-31 - Incorporate DB2 Tables/Views - Search-crit.: Table/View name=ALL,DB name=ALL,Creator=ALL Doc. Cmd Creator Table/View name Database T exists Remark __ ABA DEMO1 DSNDB04 T No __ ABA PLAN_TABLE DSNDB04 T No __ AZ APPT_TODAY DSNDB04 V No __ AZ D_BAR PREDICT T No __ AZ D_FX PREDICT T No __ AZ D_NAT1 DSNDB04 T Yes
|Columns in the List|
|Creator||Creator in DB2.|
|Table/view name||Name of the table/view.|
|Database||Name of DB2 database(s) where the table/view is implemented.|
|Remark||Any of the following type-specific remarks or blank. For type-independent remarks see Remarks which apply to all Object Types.|
The tables/views in the list can then be processed by entering a function code in the Cmd column. The functions T, C and I apply.
Corresponding DB2 tables/views and Predict file objects of type D and E are identified by DB2 table/view name.
Compares DB2 table/views and corresponding Predict file object. Differences between field lists and attributes of the tables/views are reported.
If no differences between the field lists are found and Connect automatic is set to Y, the DB2 tables/view and the Predict file object are connected.
Connects DB2 tables/views to Predict file object and
copies current information from the DB2 catalog to the dictionary object;
writes to the generation log of the Predict file object that a corresponding implemented table/view existed when the connection was established.
DB2 databases, storagegroups and tablespace and tables/views a table/view is related to must be documented in Predict before the table/view can be incorporated. This function finds all objects that are not documented. These can then be incorporated before the table/view is incorporated.
One Predict file object is created for each table or view. The ID of the new file object consists of the creator name and DB2 name of the table or view joined by a hyphen.
One field object is created for each field in the table or view. The ID assigned to each new field object will be the name of the field in DB2. For each view that is incorporated, the appropriate parts of the subselect specification in the SQL statement CREATE will be copied to the file and field objects created.
One field object is added to file SAG-DISTINCT-TYPE for each distinct type that is not already documented. The ID assigned to each new field object consists of the schema name and the type name concatenated by a hyphen. The connection between the standard fields of SAG-DISTINCT-TYPE and the table field is established if the field in DB2 is distinct type.
One Predict file object with file type IV (Intermediate view) is created for each subselect clause in the from clause of a view definition. For each column in the select list of subselect a Predict field object is created. For each intermediate view that is created, the appropriate parts of the subselect specification in the SQL statement CREATE will be copied to the file and field objects created.
One Predict field object (type SP) for each composite index is created.
One Predict field object (type SP) for each composite foreign key is created if there is not already a Predict field object for a composite index built from the same columns.
One Predict relationship object is created for each foreign key.
Labels defined for columns are documented as field headers.
A trigger object is added for each trigger defined for a table or view. A link is established either to the file object via association "Has TR" or to the corresponding field objects in case of an update trigger.
A verification is added and linked to the corresponding field for each check constraint that is defined for one column.
Attributes of the corresponding file object are updated for each table check constraint (check expression for more than one column).
Specify the following parameters in an additional input screen before executing the function.
|Comments as abstract||
|List incorporated code||
|Document as table||
Enter parameters on the next line in positional or keyword form.
|Tables or Views||TYPE||2|
|DB2 Database name||DB2NAME||4|
|List incorporated code||LIST||8|
|Update file attributes||UPD-FILE||10|
|Document as table||AS-TABLE||12|
The keyword ABSTRACT can be used as a synonym for COMMENT.
If you explicitly set SQL-SERVER to blank in order to use the default server, another keyword must be specified after the SQL-SERVER keyword. If it is not possible to specify another keyword, the SQL-SERVER keyword must be followed by "D1=*" as shown below:
To incorporate the table "TDEPT" in database "DSN8130", code the command:
INCORPORATE TABLE TABLE=TDEPT,TYPE=T,DB2NAME=DSN8130,,SUB-FUNCTION=I
INCORPORATE TABLE TDEPT,T,DSN8130,,I
The example above uses the Natural parameters