Results 1 to 4 of 4

Thread: Subtables

  1. #1
    Join Date
    May 2005
    Posts
    1,191

    Unanswered: Subtables

    My main database table has about 10 fields in it. Each record needs to have a table (or possibly two) associated specifically with that table. Is there a way create a table and associate it exclusively with that record? Thank you to anyone who can help.
    Me.Geek = True

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by nckdryr
    My main database table has about 10 fields in it. Each record needs to have a table (or possibly two) associated specifically with that table. Is there a way create a table and associate it exclusively with that record? Thank you to anyone who can help.
    Hi Nick
    Assuming you mean you mean you want to associate a table or two with each record then I suspect this may be one of those times when it would be better to state you business requirement - I doubt it is necesary to have a table per record. Give us a go - we might surprise you with some out of the box thinking
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    May 2005
    Posts
    1,191
    I am creating this database from scratch. It is designed to organize Work Order requests. Everytime a new Work order is requested, it needs to be created via a form in the database (I have already created the form). But each request also needs to log two types of data (hence the two tables). One table is to record important milestones (E.G. start, switches departments, finish, etc.), and needs to have 3 columns and 14 rows. The other table records the parts each work order requests and how many of each part it needs, so two columns of 13 or 14 rows. I don't simply want to create 70 new fields in my main table to support this data. So, ideally, I want to have two subtables associated with each record.

    Hope this helps clarify my problem. Again, any help you can offer is much appreciated.
    Me.Geek = True

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Hi Nick
    it sounds like you have a realtional design issue - R937's site is always worth a read in this context. I think basically you have alrady rationlised you model into requirng another 2 tables. The issue is that you perceive these as unique to each record, as opposed to a table containing all milestones / part requests assoicated to their relevant work no by the worknoID.

    One table is to record important milestones (E.G. start, switches departments, finish, etc.), and needs to have 3 columns and 14 rows. The other table records the parts each work order requests and how many of each part it needs, so two columns of 13 or 14 rows.
    it may be that you need to implement each element as 2 tables:-
    one contains your milestones. It might be a good idea to desing your key to incorporate the work order as oart of the primary key along with the milestonetype so that you can force only one milestone type per workorder In fact you may want to include a milestone type table .
    The other contans parts requested- this could be more complex, presmably you will also need a table containing the part definitions.


    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •