Error
Error

Reputation: 825

Oracle data modeler logical design unique constraint

How can I define column to be unique when creating logical model? It's because I want to create relationship 1:N and both columns are not primary key. I tried to define surrogate keys when defining relationship and typed column names in field Name of source/target, but when creating relational model, I don't get what I want. So basically I want define which columns from tables go into relationship and define unique constraint over column with multiplicity 1.

Upvotes: 1

Views: 8847

Answers (2)

K P
K P

Reputation: 11

I found that I can set up Unique Constraints in the Relational Model in the Table Properties. There is an item in the list called "Unique Constraints" name the Constraint and then add the column. After that click the check box to generate the DDL for the constraint.

Upvotes: 1

Walter Mitty
Walter Mitty

Reputation: 18940

just use the UNIQUE constraint.

http://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses002.htm

BTW, why are you using a FK that does not reference the PK? You might need to do this, but you might also consider refining your conceptual model so that the reference can refer to the PK.

Upvotes: 0

Related Questions