RELATIONS AND TABULAR FORM [message #339977] |
Sun, 10 August 2008 11:19 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Kurtn1986
Messages: 5 Registered: August 2008 Location: Belgium, Europe
|
Junior Member |
|
|
Hello, i'm new to Oracle Forms from Developer Suite 10G.
I've got a small problem with my relations between 4 blocks.
A company has a project and multiple students are assigned to a project through a contract.
These are my 4 blocks:
1. COMPANY -->(FORM)
CCODE (NUMBER)
CNAME (VARCHAR2)
2. PROJECT -->(FORM)
PROJCODE (NUMBER)
CCODE (NUMBER)
PROJTITLE (VARCHAR2)
3. CONTRACT -->(FORM)
PROJCODE (VARCHAR2)
SCODE (NUMBER)
DCODE (VARCHAR2)
CTEMAIL (VARCHAR2)
4. STUDENT -->(TABULAR)
SCODE (VARCHAR2)
SNAAM (VARCHAR2)
The relation between company and project is based on CCODE (master-detail relation). Same between project and contract (based on PROJCODE).
But this is the problem: Contract contains several SCODE (Studentnumbers) which are different from each other. With the use of a master-detail relation, only the first student is displayed in the tabular form. How can I solve this?
Example: We got a contract with PROJCODE = 17 and the tabel CONTRACT
contains 2 rows: PROJCODE = 17 has SCODE = 042527 || PROJCODE = 17 has SCODE = 032456. The master-detail relation between contract and student returns only the first found student, while it should be 2.
Thx for helping me out.
Kurt
|
|
|
Re: RELATIONS AND TABULAR FORM [message #339986 is a reply to message #339977] |
Sun, 10 August 2008 14:54 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
One way would be to remove the fourth block (STUDENT) and modify the third block (CONTRACT) from "form" to "tabular" because the only information the fourth block offers is a student name (if that's what SNAAM column is). If so, just add a display item and populate it in the POST-QUERY trigger.
If you insist on the fourth block, standard master-detail relationship can not do that because of the column which makes the relation - SCODE. Every record in the CONTRACT block contains only one SCODE, and you can't expect having more than single "detail" record for a single student.
However, you might remove the relationship and use DEFAULT_WHERE for the STUDENT block. It would, actually, be a subquery, such as
'WHERE scode IN (SELECT scode FROM contract
WHERE projcode = ' || :contract.projcode ||')'
I didn't test it, but you might try. Although, in my opinion and regarding the information you provided, the first option is more acceptable (to me).
|
|
|
|
|
Re: RELATIONS AND TABULAR FORM [message #340085 is a reply to message #339977] |
Mon, 11 August 2008 06:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Kurtn1986
Messages: 5 Registered: August 2008 Location: Belgium, Europe
|
Junior Member |
|
|
Ok,
I solved the problem by deleting the 4th block and adding items to the contract-block. Then I used the post-query like you said and it is a succes!
Thx for helping me out.
|
|
|