Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Fetching records matching condition in a master-detail relation

Re: Fetching records matching condition in a master-detail relation

From: Graham Miller <lgmiller_at_elmrd.u-net.com>
Date: Tue, 21 Apr 1998 12:39:41 GMT
Message-ID: <353c6f53.4931880@news.u-net.com>


dwarakv_at_hotmail.com wrote (in <6hh87u$fg8$1_at_nnrp1.dejanews.com>)...

snip]
| ... I would like him/her to see only the people
| associated with him. For e.g., I have users 1, 2. The people associated with
| user 1 are 6, 7, 8. Those associated with 2 are 9, 10, 11. When user 1
| performs a query, he should be able to see only the records corresponding to
| people 6, 7, 8 and he should NOT be able to see anything relating to people
| 9, 10, 11. I do have an LOV which lets user 1 select only from people 6, 7,
| 8. But if the user hits F8, the query shows all the people, namely, 6, 7, 8,
| 9, 10, 11. Is there some way I can do this? I tried assigning to the where
| clause of the master block this condition (master_block.user = user_id, but
| when I try to query, I get error FRM-40505 (unable to perform query)).
|

You almost have it except that you have to use a subquery to restrict the list of people to show. i.e. put the query in your LOV in a subquery in the block default where clause.

| I have a second related question. I have different fields in the detail
| block. One of the fields is a status field which tells if the person is in
| the company or not. When doing the query, I don't need the query to show
| people who are no longer in the company. For e.g in the above example itself,
| if person 8 was terminated, when user 1 does a query he should see only
| people 6, 7 and NOT 8.

|
This is again a default where clause on the detail block.

graham Received on Tue Apr 21 1998 - 07:39:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US