Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Views

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have been trying very hard now to create a master/detail relationship. It is not working because the detail table has one key while the master table has 3.
It is difficult for me to get the relationship to work like this.
detail.key = master.key1
or detail.key = master.key2
or detail.key = master.key3.
What I am trying to accomplish is to enter an id in detail block, and have that id populate ONLY one of the master items id automatically.
for example, if I enter id 12 on detail block and pull up detail blocks id and name, I want that id and name to populate master record values of id and name based on a join between detail.key and master.key1 etc.
Since that is not working, I have been suggested to try views. Can anyone please guide me on that.
Thanks,
 
This is a poorly designed DB case.

You can use a decode function in your view to do something like
decode(nvl(key1,-99).-99,nvl(key2,-99),-99,key3)

maybe this will solve your problem.

Or create a function in the database that returns the value of the key after deciding where it is at and build a view with a select of this function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top