This document covers the following topics:
Generation of DB2 objects is subject to DB2 security mechanisms. See the section DB2 and SQL/DS in the Predict and Other Systems documentation for more information.
The following parameters can be set in all DB2 object types.
Parameters | |||
---|---|---|---|
SQL Server |
This parameter is defined on page 2 of the schema generation wizard. This page does not appear when only the default server can be used. The SQL server, the object will be implemented in. The value is preset with the value specified in the user or system profile. |
||
Use SQLID | To switch from the logon user ID to a group ID in DB2,
you can enter a different SQL ID in this field. The statement SET CURRENT
SQLID will then be submitted.
|
||
List DB2 statement |
|
||
Protocol saved in member | SQL statements generated for the implementation of the database can be saved in a Natural source member (protocol) on the FDIC file. A member name for the protocol is only required when the DB2 object is generated for the first time. SQL statements generated in subsequent generation runs are concatenated to the protocol. The protocol can be displayed using the Display function of the Administration Implemented object-type menu of Predict. | ||
Protocol saved in library | Library where the protocol is to be saved. |
A DB2 database can be implemented with Dictionary View by generating the necessary SQL statements. The generated SQL statements can be saved in a generation protocol.
Note:
This function is only available if DB2 is installed in your
server environment. The function is not
applicable to SQL/DS.
The following topics are covered below:
Values for fields which have been locked by your data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.
Common parameters which are not included in the table below are described under Common Parameters for All DB2 Types.
Presetting | |||
---|---|---|---|
The parameter below can be changed in the Modify DB2 Database Defaults screen of Predict. See Generation Defaults. | |||
Count of saved actions | Number (0-99) of generation actions which are stored in the protocol specified under Protocol saved in member/library. If 99 is entered, all generation actions are stored. This is the default setting at installation. | ||
Parameters | |||
Add database |
|
||
Update database |
|
The schema generation wizard uses the following keywords when showing the command that is to be processed:
Field | Keyword |
---|---|
Database ID | DB |
List DB2 statement | LIST |
Protocol saved in member | MEM |
Protocol saved in library | LIB |
Add database | ADD-DB |
Update database | UPD-DB |
Use SQLID | SQLID |
SQL Server | SQL-SERVER |
If a parameter is not specified, the default value is taken.
Database-ID: EXAM-DATABASE CREATE DATABASE EXAMDB STOGROUP EXAM001 BUFFERPOOL BP1;
A DB2 procedure or function requires an object of type Program as input, from which then either a procedure or a function is generated.
Note:
This function is only available if DB2 is installed in your
server environment. The function is not
applicable to SQL/DS.
The following topics are covered below:
Values for fields which have been locked by your data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.
Common parameters which are not included in the table below are described under Common Parameters for All DB2 Types.
Presetting | |||
---|---|---|---|
The parameter below can be changed in the Modify DB2 Proc/Function Defaults screen of Predict. See Generation Defaults. | |||
Count of saved actions | Number (0-99) of generation actions which are stored in the protocol specified under Protocol saved in member/library. If 99 is entered, all generation actions are stored. This is the default setting at installation. | ||
Parameters | |||
Add procedure/function |
|
||
Replace |
|
||
Update procedure/function |
|
||
Comment on |
|
Note:
Links concerning the associations IN (Input FI) and RE (Returns
FI) define the input and output parameters of the procedure or function.
The schema generation wizard uses the following keywords when showing the command that is to be processed:
Field | Keyword |
---|---|
Program ID | PROGRAM-ID |
Add procedure/function | ADD-PROCEDURE |
Update procedure/function | UPD-PROCEDURE |
Replace | REPLACE |
Comment on | COMMENT |
List DB2 statement | LIST |
Protocol saved in member | MEM |
Protocol saved in library | LIB |
Use SQLID | SQLID |
SQL Server | SQL-SERVER |
If a parameter is not specified, the default value is taken.
The Generate DB2 Table / View function:
Generates DB2 and SQL/DS Table/View/Indexes. If a table contains
a LOB column, the function generates a SET CURRENT
RULE='STD'
statement which allows DB2 to create the necessary
auxiliary tablespaces, tables and indexes for these objects.
Generates distinct types.
Generates check expressions. A check expression that differs from the documentation in Predict is dropped and recreated.
Generates triggers. If a trigger is linked to a DB2 view, an
INSTEAD OF
trigger is generated. A trigger that differs from the
documentation in Predict is dropped and recreated.
Modifies existing DB2 and SQL/DS Table/Indexes, replaces DB2 and SQL/DS Views/Indexes or
Purges indexes from DB2 or SQL/DS tables if no longer documented with a corresponding Predict file object of file type D (DB2 Table).
Purges masks or permissions from DB2 tables if no longer documented with a corresponding Predict file object of file type D (DB2 Table).
Note:
If an XML column (Field format LO and
Character Set
X) is added for the first time to a DB2 table, you are
recommended to run the function Compare DB2
table after the generation of the DB2 table. The function
Compare DB2 table must be executed on the server
with the update options Add fields and
Field attributes set to
Y.
The following topics are covered below:
Values for fields which have been locked by your data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.
Common parameters which are not included in the table below are described under Common Parameters for All DB2 Types.
Presetting | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The parameter below can be changed in the Modify DB2 Table/View Defaults screen of Predict. See Generation Defaults. | |||||||||||||||||||
Count of saved actions | Number (0-99) of generation actions which are stored in the protocol specified under Protocol saved in member/library. If 99 is entered, all generation actions are stored. This is the default setting at installation. | ||||||||||||||||||
Parameters | |||||||||||||||||||
Add table/view |
|
||||||||||||||||||
Replace view |
|
||||||||||||||||||
Add index | If DB2 indexes are defined for the DB2 table in
Predict, set this option to Y to generate the CREATE INDEX
statements.
|
||||||||||||||||||
Update table |
|
||||||||||||||||||
Update index |
|
||||||||||||||||||
Purge index |
|
||||||||||||||||||
Column masks |
|
||||||||||||||||||
Row permissions | Options for row permissions. Possible values: See Column masks option above. | ||||||||||||||||||
Defer option for indexes |
|
||||||||||||||||||
Label on |
|
||||||||||||||||||
Comment on |
|
When generating temporal tables, Predict only requires the name of the history or archive table to be used. This history or archive table is then automatically generated and connected to the base table. The history or archive table name can be provided when documenting a temporal table in Predict.
If you want to use a history or archive table with an index of its own then this history or archive table must be documented separately in Predict. Indexes can then be defined manually where required.
Such a separate history or archive table must then also be generated separately. The connection between the base table and the history or archive table, that is normally maintained automatically in Predict, will then be dropped. You will have to manually and individually apply changes made to the base table also in the history or archive table.
After the changes have been applied, you will have to generate both, the base table and the history or archive table, individually in order for the changes to take effect.
A third generation process is then required to reestablish the connection between the base table and the history or archive table.
The schema generation wizard uses the following keywords when showing the command that is to be processed:
Field | Keyword |
---|---|
File ID | FILE-ID |
Add table/view | ADD-TABLE |
Add index | ADD-INDEX |
Update table | UPD-TABLE |
Update index | UPD-INDEX |
Purge index | PURGE-INDEX |
Replace view | REPLACE |
List DB2 statements | LIST |
Protocol saved in member | MEM |
Protocol saved in library | LIB |
Label on | LABEL |
Comment on | COMMENT |
Defer option for indexes | DEFER |
Use SQLID | SQLID |
SQL Server | SQL-SERVER |
Column masks | MASK |
Row permissions | PERMISSION |
If a parameter is not specified, the default value is taken.
File-ID: EXAM-GEN_TABLE CREATE TABLE EXAM.GEN_TABLE (EMPNO CHAR(6) NOT NULL, FIRSTNME VARCHAR(12) NOT NULL, MIDINIT CHAR(1) NOT NULL, LASTNAME VARCHAR(15) NOT NULL, WORKDEPT CHAR(3) NOT NULL WITH DEFAULT, PHONENO CHAR(4) NOT NULL WITH DEFAULT, HIREDATE DATE NOT NULL WITH DEFAULT, JOB CHAR(8) NOT NULL WITH DEFAULT, EDLEVEL SMALLINT NOT NULL WITH DEFAULT, SEX CHAR(1) NOT NULL WITH DEFAULT, BIRTHDATE DATE NOT NULL WITH DEFAULT, SALARY DECIMAL(9, 2) NOT NULL WITH DEFAULT, BONUS DECIMAL(9, 2) NOT NULL WITH DEFAULT, COMM DECIMAL(9, 2) NOT NULL WITH DEFAULT, PRIMARY KEY (EMPNO)) IN DATABASE EXAMDB EDITPROC PROGDB AUDIT NONE; CREATE UNIQUE INDEX PRDDBA.EMPNO ON EXAM.GEN_TABLE (EMPNO ASC) SUBPAGES 4 BUFFERPOOL BP0 CLOSE YES; CREATE INDEX DSN8210.XEMP2 ON EXAM.GEN_TABLE (WORKDEPT ASC) SUBPAGES 4 BUFFERPOOL BP0 CLOSE YES; DIC1880 SUMMARY: 14 FIELD(S) PROCESSED
A DB2 storagegroup can be implemented with Dictionary View by generating the necessary SQL statements. The generated SQL statements can be saved in a generation protocol.
The following topics are covered below:
Values for fields which have been locked by your data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.
Common parameters which are not included in the table below are described under Common Parameters for All DB2 Types.
Presetting | |||
---|---|---|---|
The parameter below can be changed in the Modify DB2 Storagegroup Defaults screen of Predict. See Generation Defaults. | |||
Count of saved actions | Number (0-99) of generation actions which are stored in the protocol specified under Protocol saved in member/library. If 99 is entered, all generation actions are stored. This is the default setting at installation. | ||
Parameters | |||
Add storagegroup |
|
||
Update storagegroup |
|
The schema generation wizard uses the following keywords when showing the command that is to be processed:
Field | Keyword |
---|---|
Storagespace ID | STORAGESPACE-ID |
Add Storagegroup | ADD-STORAGEGROUP |
Update Storagegroup | UPD-STORAGEGROUP |
List DB2 statements | LIST |
Protocol saved in member | MEM |
Protocol saved in library | LIB |
Use SQLID | SQLID |
SQL Server | SQL-SERVER |
If a parameter is not specified, the default value is taken.
Storagespace-ID: EXAM-STORAGEGROUP CREATE STOGROUP EXAM001 VOLUMES (VOL05 ) VCAT DB2;
A DB2 tablespace can be implemented with Dictionary View by generating the necessary SQL statements. The generated SQL statements can be saved in a generation protocol.
The following topics are covered below:
Values for fields which have been locked by your data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.
Common parameters which are not included in the table below are described under Common Parameters for All DB2 Types.
Presetting | |||||
---|---|---|---|---|---|
The parameter below can be changed in the Modify DB2 Tablespace Defaults screen of Predict. See Generation Defaults. | |||||
Count of saved actions | Number (0-99) of generation actions which are stored in the protocol specified under Protocol saved in member/library. If 99 is entered, all generation actions are stored. This is the default setting at installation. | ||||
Parameters | |||||
Add tablespace |
|
||||
Update tablespace |
|
||||
Define |
|
||||
Partitions initialized | Only for tablespaces with type G (Partition by
growth). Specifies the number of partitions to be initialized (corresponds to
the NUMPARTS option in DB2) and must not exceed the total number
of partitions defined for that tablespace.
|
The schema generation wizard uses the following keywords when showing the command that is to be processed:
Field | Keyword |
---|---|
Dataspace ID | DATASPACE-ID |
Add tablespace | ADD-TABLESPACE |
Update tablespace | UPD-TABLESPACE |
List DB2 statements | LIST |
Protocol saved in member | MEM |
Protocol saved in library | LIB |
Define | DEFINE |
Use SQLID | SQLID |
SQL Server | SQL-SERVER |
Partitions initialized | NUMPARTS |
If a parameter is not specified, the default value is taken.
Dataspace-ID: EXAM-TABLESPACE CREATE TABLESPACE EXAMTS IN EXAMDB NUMPARTS 4 BUFFERPOOL BP0 LOCKSIZE ANY CLOSE NO;