Re: Trying to Create Named Foreign Keys in ER-Win

From: Scott Kronheim <skronheim_at_synertechsystems.com>
Date: Wed, 26 Jan 2000 12:51:03 -0500
Message-ID: <388F3407.DB664DAE_at_synertechsystems.com>


To give a foreign key constraint a name that will follow through to the database, do this:
1. Go to the physical view of your model. 2. Right-click on the relationship line that indicates the foreign key you would like to name.

3.  Click on the "Relationship Editor" option.
4.  Select the "General" tab.
5.  Enter the name you want in the "Foreign Key Constraint Name" field.
When you forward-engineer your model into the database, make sure that the "Constraint Name" option is selected (this option is found under the "Other Options" set), or ER-Win will not specify the name you just added.

FYI, you can specify the the Oracle PK index name for a table by doing this:

1.  Go to the physical view of your model.
2.  Right-click on the table whose PK index you want to rename.
3.  Click on the "ORACLE Index" option.
4.  Click the PK index in the list box.
5.  Click the "Rename" button.
6.  Enter the new name, then click "OK".
If you want the DDL to create the table without a PK then alter the table to add the PK constraint, when you forward-engineer your model into the database, make sure that the "ALTER/PK" choice for the "Primary Key" option is selected (this option is found under the "Referential Integrity" set).

Scott Kronheim

Sean Phelan wrote:
>
> Hi all,
>
> Has anyone successfully used ER-Win to model an Oracle Database, naming the
> foreign key constraints?
>
> The desired DDL looks like:
> -------------------------------------------
> PK:
> alter table T_PROC_DETAILS
> add constraint PK_PROC_DETAILS
> PRIMARY KEY (PROC_ID);
>
> FK:
> alter table T_CURRENCY_EXCHANGE
> add constraint FK_CURRENCY_EXCHANGE
> FOREIGN KEY(CURRENCY_CODE)
> REFERENCES CURRENCY(CURRENCY_CODE)
>
> ----------------------
>
> Using ER-Win's Post-Script feature with Macros, I've successfully built the
> Primary Keys, but the Foreign key issue is killing me.
>
> In the end, it's more an Er-Win question than an Oracle question, but I
> figured I might get lucky. Any one know how to do it?
>
> Or, alternatively, does anyone know of an ERWin newsgroup?
>
> TIA,
>
> Sean Phelan

--
Received on Wed Jan 26 2000 - 18:51:03 CET

Original text of this message