I would strongly suggest you draw a data model (entity-relationship or whatever) for these tables. I suspect you have started off on the wrong foot and a diagram should help you clarify the situation. Then start to put it together one table at a time.
(Check that you have the (+) on the correct side of the conditions. Some of your conditions look suspect to me, though it's hard to tell without knowing your application.)
I think there is something fundamentally wrong. The only relationship between poam and milestone I can see is this:
Code:
p.poam_id = w.poam_id (+) AND
w.weakness_id (+) = m.weakness_id
Which, if it were permitted and meant something, would:
EITHER produce a Cartesian product - all rows of poam would match all rows of milestone via the NULL rows of weakness in the outer join (allowing NULL=NULL to be true)
OR lose all the rows where there are none corresponding in weakness (allowing NULL=NULL to be false), in which case you don't have an outer join.
What I have just written boarders on the incomprehensible - you need a picture. I say again: LOOK TO THE DATA MODEL.
This is how you avoid the outer join error
the weakness table w is by itself, all other tables are in an
inline view ot. Now oracle thinks you are outer joining one table to another (one) table. This is what I wanted to acheive in the first answer just to get you through ORA-01417
You are going have to add some joins in an inline view. You have 6 tables and only 3 are joined. If the one below runs it will cartesian if you don't add more joins
SELECT
ot.poam_id,
w.weakness_id,
w.weakness_desc,
w.poc,
w.total_resources_required,
w.scheduled_completion_date,
ot.milestone_desc,
ot.scheduled_completion_date,
ot.change_log,
ot.weakness_source_type_desc,
ot.weakness_milestone_status_desc,
w.omit_from_omb
FROM
(select p.poam_id, m.milestone_desc, m.scheduled_completion_date, mcl.change_log,
rwst.weakness_source_type_desc, rwms.weakness_milestone_status_desc,
from
poam p, milestone m, milestone_change_log mcl,
weakness_source ws, ref_weakness_source_type rwst,
ref_weakness_milestone_status rwms
where
ws.weakness_source_type_code = rwst.weakness_source_type_code AND
m.milestone_id = mcl.milestone_id) ot,
weakness w
WHERE
ot.poam_id = w.poam_id(+) AND
ot.weakness_id = w.weakness_id(+) AND
ot.weakness_milestone_status_code = w.weakness_status_code(+);
Bookmarks