Solved

Delphi database relationships

Posted on 1998-04-13
2
216 Views
Last Modified: 2013-11-23
Hello all,

      I'd like to knom how to built 1 to 1, 1 to n, m to n relationships in delphi databases using paradox tables? Paradox allows duplicated keys? How?

                  Tanks in advance
0
Comment
Question by:oberdan
2 Comments
 
LVL 5

Expert Comment

by:julio011597
Comment Utility
Yes, Paradox tables allow duplicate keys as long as they belong to secondary indexes.

Is this what you were looking for?
0
 
LVL 4

Accepted Solution

by:
itamar earned 100 total points
Comment Utility
Hi oberdan,

To implement relations:

1 to 1 - ORDERS.CustNo -> CUSTOMERS.CustNo
             In CUSTOMERS, CustNo must be the primary key or a unique index, so the relation will be from 1 record to 1 record;

1 to n - ORDERS.OderNo -> ITEMS.OrderNo
            In ITEMS, OrderNo must be a SECONDARY index AND with the Unique check box             unchecked. (This answer your second question). It's a typical master/detail model.

m to n - Not only in Paradox, but in any relational model, you must convert this relation in a               separated table with 2 fields, one for each foreign key of the tables related.

I sugest you to take a look at the ORDERS and ITEMS tables of DBDEMOS alias of Delphi.
There are typical cases in it.

IHTH,
Itamar


0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now