0

Hello,

I need to create ER + relational models. I've came across Embarcadero Studio Data architect, but I'm having some trouble using it.

What's the problem? I want the bottom table (PunctLucruActivitate) IDFirma to be in a relationship with IDFirma from the left table (PunctLucru). It won't let me do that.


Thanks for any help.

Attachments db.png 7.76 KB db2.png 8.07 KB
3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by BitBlt
0

Here is the code:

CREATE TABLE PunctLucru 
   ( 
     IDPunctLucru NUMBER, CONSTRAINT IDPunctLucru_pk PRIMARY KEY(IDPunctLucru), 
   );

CREATE TABLE Activitate
   ( 
     IDActivitate NUMBER, CONSTRAINT IDActivitate_pk PRIMARY KEY(IDActivitate), 
   );

CREATE TABLE PunctLucruActivitate
   ( 
     IDActivitate NUMBER, CONSTRAINT IDActivitate_fk FOREIGN KEY(IDActivitate) REFERENCES Activitate(IDActivitate), 
     IDPunctLucru NUMBER, CONSTRAINT IDPunctLucru_fk FOREIGN KEY(IDPunctLucru) REFERENCES PunctLucru(IDPunctLucru),
     CONSTRAINT IDcampuri_pk PRIMARY KEY(IDActivitate, IDPunctLucru)
   );

Could I just finish the code and have the models automatically generated based on the tables/code?

Edited by Buffalo101: n/a

0

The picture is correct, your subsequent code just doesn't match it.

When you create an identifying relationship from parent to child, you will be migrating ALL parts of the primary key, e.g. from PunctLucru to PunctLucruActivate. If IDFirma is in the primary key (it is), it migrates.

Your picture shows IDFirma in the primary key of PunctLucru. Your code doesn't mention IDFirma in PunctLucru at all...it should be a foreign key to a third table (not in your picture, I guess). So the problem isn't with the tool. The problem is that your code doesn't reflect the picture.

Or am I just not understanding what you're after?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.