472,119 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

Error 3386: Relationships Must Be on Same Number of Fields

Hi Everybody-

I know that this is a really, really long post, but I wanted to try to
give you as much background as possible.

So here's a quick overview of the issues I'm asking for help with:

1.) I'm trying to create a many to many relationship, and I get the
following Error when I try to enforce referential integrity.

Error 3386: Relationships must be on the same number of fields with
the same data types.

2.) I need some advice on creating some Tables and Relationships.
Each CASE can have one or more ISSUES. Therefore, I created a Bridge
Entity/ Table called CASE_ISSUE.
Each ISSUE can have one and only one DECISION.
But each DECISION can be associated with one or more ISSUES.
So, I created a Bridge Entity/ Table called ISSUE_DECISION.

For example:

A CASE can have the ISSUEs, Age Discrimination and Illegal Drug Use.

A CASE can have the ISSUE, Sexual Harassment.
The ISSUE, Age Discrimination, can have the DECISION, Guilty or Not
Guilty.

The ISSUE, Illegal Drug Use, can have the DECISION, Guilty or Not
Guilty.

The ISSUE, Sexual Harassment, can have the DECISION, Guilty or Not
Guilty.
The DECISION, Guilty or Not Guilty, can be associated with any of the
ISSUEs, Age Discrimination, Illegal Drug Use, or Sexual Harassment.
Each ISSUE has one DECISION. But a DECISION can be associated with one
or more ISSUES.

Right now, I've got a table, ISSUE, listing over 100 different issues.
I've also got a table, DECISION, that lists the 20 decisions that can
be applied to those issues.

Maybe I've got my relationships messed up. Right now, I've got a many
to many relationship between ISSUE and DECISION with the bridge table,
ISSUE_DECISION.

Maybe I need a one to many relationship between DECISION and ISSUE?
But if I do that, then I'll need to add the attribute, DecisionID, to
the ISSUE table, right?

BUT...I'm using combo-boxes to display the descriptions of the Issues
and Decisions. These combo-boxes are linked to the tables, ISSUE and
DECISION, to retrieve the descriptions.

Here's where I'm going...

CASE table:
CaseID (Autonumber & Primary Key)
LastName
FirstName
Other attributes...

CASE_ISSUE
CaseID (Number & Primary Key)
IssueID (Number & Primary Key)
NOTE: I'm thinking about creating a New Primary Key called
"Case_Issue" instead of having CaseID and and IssueID as the Composite
Primary Key (Is this the correct term?)

ISSUE table:
IssueID (Number & Primary KEY)
IssueDescription (Text)

DECISION table:
DecisionID (Number & Primary Key)
DecisionDescription (Text)

ISSUE_DECISION table:
IssueDecisionID (Autonumber & Primary Key)
CaseID
IssueID (Foreign Key to ISSUE table)
DecisionID (Foreign Key to DECISION table)

When I try to create a one to many relationship between the ISSUE
table and ISSUE_DECISION table by dragging "IssueID" from
ISSUE_DECISION to ISSUE, I get "ERROR 3386: Relationships must be on
the same number of fields with the same data types."

Well, maybe I should give you some examples of what the tables look
like with sample data in them.

************************************************** ***************************

CASE table:

*CaseID* LastName FirstName
100 Simpson Jessica
200 Lachey Nick
300 Trump Donald

ISSUE table:

*IssueID* IssueDescription
1 Age
2 Sexual Harassment
3 Drugs

CASE_ISSUE table:

*CaseID* *IssueID*
100 1
100 3
300 2
300 3

DECISION table:

*DecisionID* DecisionDescription
10 Guilty
20 Not Guilty
30 Compliance
40 Non-Compliance

ISSUE_DECISION table

*IssueDecisionID* CaseID IssueID DecisionID
1 100 1 20
2 100 3 30
3 300 2 10
4 300 3 40

************************************************** ***************************

NOTE: I have a many to many relationship between the tables, CASE and
ISSUE, with the Bridge table, CASE_ISSUE. I CAN create the one to many
relationships here.

When I drag CASE_ISSUE.CaseID to CASE.CaseID, I CAN click "Enforce
Referential Integrity," and when I drag CASE_ISSUE.IssueID to
ISSUE.IssueID, I CAN ALSO click "Enforce Referential Integrity."

BUT When I try to drag ISSUE_DECISION.IssueID to ISSUE.IssueID and
click "Enforce Referential Integrity", I get the "ERROR 3386:
Relationships must be on the same number of fields with the same data
type."

OR when I try to drag ISSUE_DECISION.DecisionID to DECISION.DecisionID
and click "Enforce Referential Integrity", I get the "ERROR 3386:
Relationships must be on the same number of fields with the same data
type."

Questions:

1.) Do I need to create the Relationships before I populate the Tables
with data? But my tables: CASE, ISSUE, and CASE_ISSUE have data in
them, and I can create the relationships and "Enforce Referential
Integrity>"

2.) Why do I get this Error in some circumstances and not others?

3.) What kind of relationship should I create between ISSUE and
DECISION? Right now, each table provides the data for combo-boxes that
the user can select the Issue and Decision from.

Thanks for reading this post!!! I know it is really, really long! I
just wanted to try to give you as much background as possible.

I truly appreciate your TIME and EFFORT!

Megan
Nov 12 '05 #1
0 5222

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Chuck Van Den Corput | last post: by
2 posts views Thread by Max | last post: by
7 posts views Thread by davegb | last post: by
1 post views Thread by David Fairbrother | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.