Business keys for groups are defined by metadata entries
in the V_ELEMENTATTRIBUTE table, and supported by corresponding metadata
entries in the V_GROUP, V_ELEMENT, CDDWLTABLETP, CDDWLCOLUMNTP, and
GROUPDWLTABLE tables. The business key attributes and the supporting
metadata in these tables are already defined for the groups that require
business key validations.
About this task
Restriction: Only attributes that are persisted
in the database (persistent attributes) can be used to
define business keys.
Procedure
- To change the business key attributes of a group or define
additional attributes as business keys, use SQL to populate the V_ELEMENTATTRIBUTE
table with appropriate values for the business key attributes of a
group. The SQL should take the following form:
INSERT INTO DB2ADMIN.V_ELEMENTATTRIBUTE (V_ELEMENT_ATTRB_ID, ATTRIBUTE_TP_CD, APPLICATION, GROUP_NAME, ELEMENT_NAME, EXPIRY_DT, LAST_UPDATE_DT) VALUES (<Primary key value>,<Attribute type>,<Application Name>,<Group name>,<Element name>,null, current_timestamp);
- If applicable, define the primary key, child business keys,
and implicit business keys with the correct attribute type.
If
the business key should be validated only among active entity instances,
you must also define the EndDate and ExpiryDate attributes.
- Ensure that all required supporting metadata is available
in the related metadata tables:
- In the V_GROUP table, ensure that the group for which
the business keys are defined has an entry.
- In the CDDWLTABLETP table, ensure that InfoSphere MDM data
tables corresponding to the group requiring business key validation
are defined.
- In the GROUPDWLTABLE table, ensure that the group is
correctly mapped to one or more InfoSphere MDM data
tables through metadata defined in V_GROUP and CDDWLTABLE.
- In the V_ELEMENT table, ensure that the business key,
primary key, child business keys, implicit business key, EndDate,
and ExpiryDate attributes have correct element definitions.
- In the V_ELEMENT table, ensure that the elements are
correctly mapped to the respective columns of the InfoSphere MDM data
tables through DWLCOLUMN_TP_CD.
- In the CDDWLCOLUMNTP table, ensure that the columns
corresponding to business key, primary key, child business keys, implicit
business key, EndDate, and ExpiryDate attributes are defined.
- In the CDDWLCOLUMNTP table, ensure that the JDBC_TYPE
is set correctly.
The following table provides a mapping
for database types to the JDBC types:
Table 1. Mapping database
types to JDBC types
| DB2® |
Oracle |
JDBC type (code type) |
| BIGINT |
NUMBER(19,0) |
BIGINT |
| VARCHAR |
VARCHAR2 |
VARCHAR |
| TIMESTAMP |
TIMESTAMP |
TIMESTAMP |
| CHARACTER |
CHAR |
CHAR |
| INTEGER |
INTEGER |
INTEGER |
| SMALLINT |
SMALLINT |
SMALLINT |
| DECIMAL |
NUMBER(17,3) |
DECIMAL |
| CLOB |
CLOB |
CLOB |
| XML |
XMLTYPE |
VARCHAR |
| DATE |
DATE |
DATE |
| DOUBLE |
DOUBLE PRECISION |
DECIMAL |
| REAL |
REAL |
REAL |