Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using erwin to generate db2 ddl scripts

Status
Not open for further replies.

ddiamond

Programmer
Apr 22, 2005
918
US
I used erwin to generate db2 ddl scripts. The only problem I ran into is that erwin is generating nameless foreign keys.

For example, erwin generated:
Code:
ALTER TABLE RF_REINSURANCE_PARTICIPANT
       ADD FOREIGN KEY (CONTRACT_NUMBER)
                             REFERENCES RF_REINSURANCE_MASTER
                             ON DELETE RESTRICT;

I want erwin to generate:
Code:
ALTER TABLE RF_REINSURANCE_PARTICIPANT
       ADD CONSTRAINT [blue][b]FK_RF_RE_PART[/b][/blue] FOREIGN KEY (CONTRACT_NUMBER)
                             REFERENCES RF_REINSURANCE_MASTER
                             ON DELETE RESTRICT;

Any ideas?
 
You just be able to go the Table and then click on child relationship and rename the constraint that way.
 
I did that, and Erwin is displaying the correct relationship name. It is not using that relationship name, however, when it genarates the db2 ddl script.
 
I figured it out. On the other options tab, you have to check the "constraint name" check box if you want the constraint name to appear in your ddl.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top