Nested Sequence

From: Dean Harris <HarrisDE_at_MUOhio.Edu>
Date: 1997/10/20
Message-ID: <344B6E5E.C36030A8_at_MUOhio.Edu>#1/1


First some info. I have two tables which we can call Employer and Contact. The primary key to Employer is EMP_NO and this is a sequence. Contact is a child table of Employer's, thus part of the primary key for Contact is EMP_NO. The rest of the primary key for Contact is CONTACT_NO, which also should be a sequence, but it should be a separate sequence for each instance of Employer.

A simple example would be where Employer contains two records. We'll say EMP_NO = 10001 and 10002 for these two records. Employer 10001 has two contacts with CONTACT_NOs 01, 02 and 03. Employer 10002 also has three contacts with CONTACT_NOs 01, 02, 03. So the six Contact records would look like:

        EMP_NO        CONTACT_NO
            10001                01
            10001                02
            10001                03
            10002                01
            10002                02
            10002                03

My question is can the CONTACT_NO be a database sequence or must I accomplish this with programming in the forms which allow a person to insert new contact records?

Thanks for any info!
Dean Harris
Miami University
Oxford, OH Received on Mon Oct 20 1997 - 00:00:00 CEST

Original text of this message