Ask Experts Questions for FREE Help !
Ask
    jonmich's Avatar
    jonmich Posts: 12, Reputation: 1
    New Member
     
    #1

    Apr 4, 2005, 04:15 AM
    Master-detail
    I have a relationship between a table vehicle and conditions of vehicles.
    Now my question is how can I show the conditions if you select the vehicle by a LOV.
    The vehicle table is master and conditions is detail but I don't really know how to do it.
    I hope that someone can help me?
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #2

    Apr 4, 2005, 05:07 AM
    My SQL isn't great so I just give you some info on what you need to look for. What you need is a join. The simplest kind looks like below:

    Code:
    SELECT table1.Name, table2.Model WHERE table1.ID = table2.ID
    In this example imagine you have two tables. Table 1 has all the details of a companies customer. Table 2 contains details of what car they drive. The above statement will retrieve the names of all the customers and what model of car they drive. The table1/2 prefix is only needed when the tables have fields of the same name. They also help illustrate the point though.

    Other things you might want to search on Google for are inner and outer joins, along with left and right joins.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #3

    Apr 4, 2005, 05:51 AM
    Specifics on how you do this depends on the platform you are working in. But I can give you some general points. Every table should have a primary key field. This field should uniquely identify the record. The field should be static, meaning its value would never change. There is a debate over the using natural or surrogate keys. A natural key is one that may have meaning to the object. For example a VIN. A surrogate key is a system generated value. I personally prefer using surrogate keys. If you would like more info on this debate let me know.

    To relate one table with another, you use a Foreign Key. The FK is a field in a table that contains the value of the PK in the related table. For example, the VIN in your vehicle table might be 12345. Your conditions table would have a field that stores the VIN and each condition attributable to vehicle 12345 would have that value as its FK.

    Like I said earlier, where you go from here depends on the platform you are using and how you want to display things. If you want to do it in a report, you would create a query that joins the 2 tables and then use that as the basis of your report.
    jonmich's Avatar
    jonmich Posts: 12, Reputation: 1
    New Member
     
    #4

    Apr 4, 2005, 06:04 AM
    I am working in oracle forms 6i.
    I have to make an application, the meaning of this question is that I can choose a vehicle by a LOV and then I have to see al its conditions but I don't know how to do it.
    I always have to press the 'execue query' button.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #5

    Apr 5, 2005, 05:30 AM
    I have no experience with Oracle forms. I suggest you check their site for forums that support that.

    I suspect you need to do something that synchronizes the forms or uses a subform or whatever the equivalent is for Oracle forms.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Let me detail it better [ 1 Answers ]

How possible is it to get pregnant on your period and could it mean I'm pregnant if my period stopped right after I had sex?

New Master Bath [ 1 Answers ]

I have read some earlier posts and thought they were very informative, so I thought I would post my delema. I have built a new addition part of which is a new master bath. Along the backwall there is (in row) Toilet, Tub and a separate shower. My original plans call for a 3" drain connecting...

Stinky Master Toilet [ 7 Answers ]

Hello. I am having a problem w/a stinky master bedroom commode. 4-level house is 18 years old and since we moved in @8 years ago, the top floor master johnnie has had about a 50-60% 'clear ratio' when flushed. It really never gets stopped up, but you have to sometimes flush it 1-3 times to...

Master Degree in E-Business [ 1 Answers ]

Good day to, I would like to have a Master degree in E-Business if anybody can help me to find an excellent collage. I have one year work experince. Best wishes


View more questions Search