/* All Products */
SELECT DISTINCT 
       osc.PROD_ID,
	   pkg.pkg_name,
	   pv.pkg_version,
	   pd.IS_REJECTED,
	   pkg.pkg_id,
	   pv.is_patch	   
  FROM bom_contents bc, 
   	   operating_systems os, 
       os_contents osc,
	   PACKAGES pkg,
  	   PACKAGE_VERSIONS pv,
	   PRODUCT_DETAILS pd
 WHERE osc.os_id = os.os_id 
   AND os.node_id = bc.node_id
   AND bc.bom_id = :BOM_ID
   AND pd.PROD_ID (+) = osc.PROD_ID
   AND pv.pkg_id = pkg.pkg_id
   AND osc.prod_id = pv.pv_id 
 ORDER BY UPPER(pkg.pkg_name), UPPER(pv.PKG_VERSION) 
