SELECT distinct pkg.pkg_name, pv.pkg_version, proj.proj_name, b.bom_id, nn.node_name, os.os_name, os.os_id,
br.branch_name, bn.bom_name, b.BOM_VERSION ||'.'|| b.BOM_LIFECYCLE AS VERSION, pv.pv_id 
FROM package_versions pv, packages pkg, os_contents osc, operating_systems os,
network_nodes nn, bom_contents bc, boms b, bom_names bn, 
branches br, dm_projects proj
WHERE pv.pkg_id = pkg.pkg_id
AND osc.prod_id = pv.pv_id
AND os.os_id = osc.os_id
AND nn.node_id = os.node_id 
AND bc.node_id = nn.node_id
AND b.bom_id = bc.bom_id
AND bn.bom_name_id = b.bom_name_id
AND br.branch_id = b.branch_id
AND proj.proj_id = br.proj_id
AND br.is_hidden IS NULL
AND LOWER(pkg.pkg_name) LIKE LOWER('/*PKG_NAME*/')
AND NVL(LOWER(pv.v_ext),'LINK_A_NULL') LIKE NVL(LOWER('/*V_EXT*/'),'LINK_A_NULL') 
ORDER BY UPPER(pv.pkg_version), proj.proj_name, br.branch_name, bn.bom_name, version, nn.node_name, os.os_name 