I've been trying to combine these queries with no success
Simply selecing fol.r_folder_path from dm_folder fol doesn't work and I am unsure why...
SELECT distinct(rec.r_object_id) as record_obj_id, rec.accession_no, rec.pier_content_type, rec.archive_status, rel.relation_name, t.object_name as template_name, t.exempt_from_review, fol.r_folder_path
FROM dm_relation rel, pier_record rec, pier_template t, dm_folder fol
WHERE rel.parent_id = rec.r_object_id
AND rel.child_id = t.r_object_id
AND rec.accession_no in ('6929860','6929838','6929866','6929825','6929830','6929746','6929688','6929839','6929872','6929816','6929770','6929731','6929715','6929821','6929726','6929815','6929656','6929631','6929621','6929737','6929824','6929627','6929639','6929607','6929571','6929736','6929743','6929722','6929677')
SELECT temp.r_object_id, temp.object_name, temp.title, temp.owner_name, temp.acl_name, fol.r_folder_path
FROM pier_template temp, dm_folder fol
WHERE temp.i_folder_id = fol.r_object_id
AND r_folder_path is not nullstring enable(ROW_BASED)
I am hoping to return the folder path but I get an error 'ORA-00942: table or view does not exist'
Edit: It appears the JOIN clause doesn't exist in DQL, I guess some stuff doesn't cross over... I think then I need to find a shared id in this dm_relation table I can use, perhaps.
Edit2: I think it's working!
SELECT DISTINCT
(rec.r_object_id) as record_obj_id,
rec.accession_no,
rec.pier_content_type,
rec.archive_status,
rel.relation_name,
t.object_name as template_name,
t.exempt_from_review,
fol.r_folder_path
FROM
dm_relation rel, pier_record rec, pier_template t, dm_folder fol
WHERE
rel.parent_id = rec.r_object_id AND
rel.child_id = t.r_object_id AND
t.i_folder_id = fol.r_object_id AND
fol.r_folder_path is not null AND
rec.accession_no in ('6929860','6929838','6929866','6929825','6929830','6929746','6929688','6929839','6929872','6929816','6929770','6929731','6929715','6929821','6929726','6929815','6929656','6929631','6929621','6929737','6929824','6929627','6929639','6929607','6929571','6929736','6929743','6929722','6929677') enable(ROW_BASED)
If I understand you correctly, you are getting too many results from the first query and the second query is an attempt to filter the results more fully. That makes sense, because as APC already said you are lacking a JOIN condition on DM_FOLDER.
It seems easy to add the conditions from the second query to the first: