col piname format a30
col brpath format a8
col iter format a5

-- The three lines before this format the output

-- now comes the actual query
 
select pivid, piname, pi.piid, br.brpath, pivrev||'.'||pivver "Iter" from pdm.pdm_productitemversion piv, pdm.pdm_productitem pi, pdm.pdm_branch br where pi.piid = br.piid and br.brid = piv.brid and piv.pivid in (select distinct genpivid from pdm.pdm_geninsrel where doid in (select doid from pdm.pdm_derivedcomponent where
substr(coltitle,3,1) <> 'Y' and substr(coltitle,3,1) <> 'N'
and piid is null))
order by piname;

-- The output of this query will list object ids, names and iteration numbers.
-- If you get "no rows selected" then this schema does not have family table assemblies with replaced components with null piid.

