Home » Developer & Programmer » Forms » master-detail relations guide required (oracle 9i)
master-detail relations guide required [message #510394] Sat, 04 June 2011 14:40 Go to next message
usman_noshahi
Messages: 4
Registered: January 2011
Location: pakistan
Junior Member

hi, my name is usman I am new in developing. I'm using oracle 9i and 6i developer suit
my question is that : can we make relation between two tables where master-table is in form means showing single record
whereas the detail-table is in tabular form , is it possible ?
the situation is like this
master table: student_no , student_name ,student_class
detailed table: book_name , total_marks , gained_marks ,credit_hours , gpa...

detailed block is in tabular form say showing 8 records of books
English , math so on and marks accordingly ..

after execute query in detailed tabled shows 8 books and gpa etc
against single name and roll number field in the master table.
means recored in master table is "usman" and in detailed table it's showing
8 books and gpa etc.

how can I do that ?
Re: master-detail relations guide required [message #510397 is a reply to message #510394] Sat, 04 June 2011 15:41 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I explained it recently, here. The only difference is that you wouldn't base both blocks on the same table, but on different ones. Basically, quite an easy task - just follow Data Block Wizard.
Re: master-detail relations guide required [message #510398 is a reply to message #510397] Sat, 04 June 2011 16:26 Go to previous messageGo to next message
usman_noshahi
Messages: 4
Registered: January 2011
Location: pakistan
Junior Member

thanks dear , I got this example already. . .. .
according to the explanation we must have same fields in both the tables emp_tbl and dpt_tbl , and the fields 'emp_dpt_no' and dpt_no must exist in both the blocks .. and in the relation we keep them equal
dpt.dpt_no= emp.emp_dpt_no

like this? I have made it, it works
but I have problem like this
in student information I have name and roll number(in the master table)
but in academic performance table (which is detailed and tabular) there is no need to enter roll number again and again before starting enter data in each record, like book name , total marks and gpa etc ...
simply no same fields to be made in relation, so how can I display all the academic performance in detail block by having roll number in master table?
Re: master-detail relations guide required [message #510399 is a reply to message #510398] Sat, 04 June 2011 17:48 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
How are these two tables related exactly?
Re: master-detail relations guide required [message #510411 is a reply to message #510399] Sun, 05 June 2011 10:38 Go to previous messageGo to next message
usman_noshahi
Messages: 4
Registered: January 2011
Location: pakistan
Junior Member

cookiemonster wrote on Sat, 04 June 2011 17:48
How are these two tables related exactly?


actually relation is that: university grants a student only one roll number but in a class 6 subjects are taught so single student attempts exams of 6 subjects. . . .. . ..
I hope my dear friend cookiemonster you got my point. . .?
Re: master-detail relations guide required [message #510418 is a reply to message #510411] Sun, 05 June 2011 13:02 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well if the relationship is on roll number then that's what you specifiy in the datablock wizard.
So why aren't you doing that?
Re: master-detail relations guide required [message #510422 is a reply to message #510398] Sun, 05 June 2011 14:59 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
usman_noshahi wrote on Sat, 04 June 2011 23:26
I have roll number (in the master table) but in detailed table there is no need to enter roll number again and again before starting enter data in each record

Exactly.

Roll number is to be used in order to join master and detail blocks. You will (most probably) display "roll number" item in master block and enter value in there.

If master-detail relationship is correctly set, Forms will maintain "roll number" item's value in detail block. Therefore, you don't need to DISPLAY roll number item in detail block (but it must EXIST in detail block).
Previous Topic: How to connect database with static ip
Next Topic: Opening a form in a Particular Tab
Goto Forum:
  


Current Time: Thu Sep 12 08:58:01 CDT 2024