Toad World® Forums

Foreign Key Constraint among Users/Schemas


#1

Hi,

yes, i used the search-function, but i only found advice, how to create a foreign key relationship within the same schema (e.g.: http://modeling.inside.quest.com/entry.jspa?externalID=1668&categoryID=158).

Can someone please explain how or where a foreign-key-constraint among tables in different schemas/users/workspace can be defined?
The result should somehow look like this:

ALTER TABLE “SCHEMA1.TABLE1” ADD CONSTRAINT “EXAMPLE_FK” FOREIGN KEY (“TABLE1_ID”) REFERENCES SCHEMA2.TABLE2 (“TABLE2_ID”)

How can i define this in TDM? My TDM-Version is 3.4.15.
Thank you very much!
Best regards

Christian


#2

Hello Christian,

I’m not sure if I understand well.
Anyway, I create Entity1 and Entity2 - each entity is in different schema. I select the schema this way: in the Entity Properties form, General tab, I select the user/schema from the User/Schema box.
Then I add a PK attribute and create a relationship between the entities.
Please find attached a screenshot.

If you have any questions, please write me. Thanks.

Regards,

Vladka
different_schema.png