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!

oracle forms - master/detail relations

Status
Not open for further replies.

moodyblues

Instructor
Mar 22, 2002
2
US
Hiya all!

Having a spot of bother writing a relation where two foreign-keys of one table reference the primary key of another table.
The two tables are 'star' and 'marriage' for a movie database. Within marriage I have M_Star_ID and F_Star_ID refencing 'Star_ID' from star. Evidently, the join condition will allow a join on one of marriage IDs but not the other. Any ideas guys and girls???
 
Hi,

If I've understand you, the relation is
marriage.M_Star_ID||marriage.F_Star_ID=star.Star_ID

Having this enviroment, the solution I'll apply is:

First create a view from the detail table, where the select will be:
"Create View marriage_view as Select M_Star_ID||F_Star_ID as foreign_id from marriage"

The you have to make a block from this view and the relation whit the master block will be: "star.Star_ID=marriage_view.foreign_id"

If you want to insert, update, etc on the view, you can do this using the triggers: ON_LOCK, ON_INSERT, ON_UPDATE, ON_DELETE.

Information about working whit updateable views at forms can be found at metalink (metalink.oracle.com).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top