We are reverse engineering a large DB2 database (400+ tables) in VP and need to reverse first the DDL’s with ‘CREATE TABLE’ statements and afterwards the DDL’s with the ‘ALTER TABLE’ statements defining the Foreign key constraints. This cannot be done at once cause the database is too large.
Unfortunately VP creates only the relationship objects when the ALTER TABLE statements are included in the same script as CREATE TABLE statements. If the ALTER TABLE statements are imported in a separate file, nothing happens (even no error message is shown).
I’ve tested this with the statements below:
CREATE TABLE EMPLOYEE (EMPLOYEE_ID varchar(255) NOT NULL,NAME varchar(255) NOT NULL,FK_CITY_ID varchar(255) NOT NULL,PRIMARY KEY(EMPLOYEE_ID));
CREATE TABLE CITY (CITY_ID varchar(255) NOT NULL,NAME varchar(255) NOT NULL,PRIMARY KEY(CITY_ID));
ALTER TABLE EMPLOYEE ADD CONSTRAINT FK_EMPLOYEE_001 FOREIGN KEY (FK_CITY_ID) REFERENCES CITY (CITY_ID);
Is there anyway that the ALTER TABLE statements can be successfully reversed in a separate DDL file?